berry
berry copied to clipboard
(π) Error message when running `yarn init -2` in a project subdirectory contains incorrect details
Self-service
- [X] I'd be willing to implement a fix
Describe the bug
Run yarn init -2 in a project subdirectory and the contents of the error don't match the command passed.
To reproduce
π yarn init -2
Usage Error: Cannot use the --install flag from within a project subdirectory
$ yarn init [-p,--private] [-w,--workspace] [-i,--install] [-n,--name #0]
This states that the --install flag is being used, which it's not.
Environment
π yarn dlx -q envinfo --preset jest
β€ YN0027: envinfo@unknown can't be resolved to a satisfying range
β€ YN0001: RequestError: tunneling socket could not be established, statusCode=407
at ClientRequest.<anonymous> (C:\Users\AMONGUS\AppData\Local\node\corepack\yarn\3.2.4\yarn.js:258:14340)
at Object.onceWrapper (node:events:628:26)
at ClientRequest.emit (node:events:525:35)
at o.emit (C:\Users\AMONGUS\AppData\Local\node\corepack\yarn\3.2.4\yarn.js:253:90235)
at ClientRequest.c (C:\Users\AMONGUS\AppData\Local\node\corepack\yarn\3.2.4\yarn.js:258:33205)
at Object.onceWrapper (node:events:628:26)
at ClientRequest.emit (node:events:513:28)
at Socket.socketOnData (node:_http_client:570:11)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at ClientRequest.c (C:\Users\AMONGUS\AppData\Local\node\corepack\yarn\3.2.4\yarn.js:258:33094)
at Object.onceWrapper (node:events:628:26)
at ClientRequest.emit (node:events:513:28)
at Socket.socketOnData (node:_http_client:570:11)
at Socket.emit (node:events:513:28)
at addChunk (node:internal/streams/readable:324:12)
at readableAddChunk (node:internal/streams/readable:297:9)
at Readable.push (node:internal/streams/readable:234:10)
at TCP.onStreamRead (node:internal/stream_base_commons:190:23)
β€ Errors happened when preparing the environment required to run this command.
Additional context
btw, I'm using yarn 4.0.0-rc.32
In a project subdirectory (I'm not, I'm in
~/projects/asdfsadfg)
You probably have a bogus yarn.lock in ~ or ~/projects.
@arcanis True, I'll update the issue to focus on these details
This message is also produced if there's a bogus package.json in a parent directory.
Getting this when trying to initialize a workspace in a monorepo in 4.3.1.
- There is a
yarn.lockandpackage.jsonin monorepo root - Thereβs no
package.jsonin immediate ancestor - Regardless of the above, the error message clearly indicates thereβs a bugβthe flag mentioned (
--install) was never passed toinit