-
-
Notifications
You must be signed in to change notification settings - Fork 220
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(create-config): updated script for latest Yarn version #969
Conversation
Should make the error readable: ``` Error: Command failed: yarn add -W -D knip typescript @types/node at genericNodeError (node:internal/errors:983:15) at wrappedFn (node:internal/errors:537:14) at checkExecSyncError (node:child_process:882:11) at execSync (node:child_process:954:15) at main (file:///private/var/folders/nq/5sbqxy457yj6_x1_28c_x2sr0000gp/T/xfs-c03b4532/dlx-61726/node_modules/@knip/create-config/index.js:49:3) at file:///private/var/folders/nq/5sbqxy457yj6_x1_28c_x2sr0000gp/T/xfs-c03b4532/dlx-61726/node_modules/@knip/create-config/index.js:58:1 at ModuleJob.run (node:internal/modules/esm/module_job:273:25) at async onImport.tracePromise.__proto__ (node:internal/modules/esm/loader:600:26) at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:98:5) { status: 1, signal: null, output: [ null, Buffer(246) [Uint8Array] [ 27, 91, 51, 49, 109, 27, 91, 49, 109, 85, 110, 107, 110, 111, 119, 110, 32, 83, 121, 110, 116, 97, 120, 32, 69, 114, 114, 111, 114, 27, 91, 50, 50, 109, 27, 91, 51, 57, 109, 58, 32, 85, 110, 115, 117, 112, 112, 111, 114, 116, 101, 100, 32, 111, 112, 116, 105, 111, 110, 32, 110, 97, 109, 101, 32, 40, 34, 45, 87, 34, 41, 46, 10, 10, 36, 32, 121, 97, 114, 110, 32, 97, 100, 100, 32, 91, 45, 45, 106, 115, 111, 110, 93, 32, 91, 45, 70, 44, 45, 45, ... 146 more items ], Buffer(0) [Uint8Array] [] ], pid: 61736, stdout: Buffer(246) [Uint8Array] [ 27, 91, 51, 49, 109, 27, 91, 49, 109, 85, 110, 107, 110, 111, 119, 110, 32, 83, 121, 110, 116, 97, 120, 32, 69, 114, 114, 111, 114, 27, 91, 50, 50, 109, 27, 91, 51, 57, 109, 58, 32, 85, 110, 115, 117, 112, 112, 111, 114, 116, 101, 100, 32, 111, 112, 116, 105, 111, 110, 32, 110, 97, 109, 101, 32, 40, 34, 45, 87, 34, 41, 46, 10, 10, 36, 32, 121, 97, 114, 110, 32, 97, 100, 100, 32, 91, 45, 45, 106, 115, 111, 110, 93, 32, 91, 45, 70, 44, 45, 45, ... 146 more items ], stderr: Buffer(0) [Uint8Array] [] } ```
The error is Indeed latest yarn does not have it https://yarnpkg.com/cli/add#options I updated this PR to fix the error. I confirm it works once the -W flag is removed: |
Hi @GauBen! Thanks for the PR. Looks like we need the I do like to use the |
What about looking for |
Sounds OK, but isn't there an easier/faster way e.g. see if the |
You could have yarn v1 saved in .yarn/releases, not sure what could be done in that matter |
Oh sorry, I'm not familiar with the implementation details of Yarn. Let's go with your idea, thanks in advance! |
What do you think of this? |
commit: |
That reads the whole file, which can be pretty large. Also it keeps things simple, so let's just roll with for now. Thanks! I'll release it shortly. |
Released as https://www.npmjs.com/package/@knip/create-config v1.0.5 :) |
🚀 This pull request is included in v5.46.0. See Release 5.46.0 for release notes. Using Knip in a commercial project? Please consider becoming a sponsor. |
Hi! I'm trying out knip but I failed to make it work. This PR should make the error readable: