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
(gatsby-cli): gatsby new
=> Command failed with ENOENT: yarnpkg
#27338
Comments
gatsby new
=> Command failed with ENOENT: yarnpkg
Please run Thanks! |
Here you are :
I don't know what I can provide in addition to what I provided in initial message for a minimal reproduction. What you pointed me at asks me to create a new Gatsby site with gatsby-cli ... my bug report says I can't even go there :) Regards, |
Ok after digging in cli sources, it seems I kept a ~/.config/gatsby/config.json file from a past installation / usage {
"telemetry": {
"enabled": false,
"machineId": "a4d009c2-1b77-4173-b49c-abb798fd6551"
},
"cli": {
"packageManager": "yarn"
}
} And gatsby-cli do trust that config file even if packageManager isn't available anymore. Perhaps hardening cli by testing if packageManager bin really exists before using it and log a warning otherwise could be a good idea. What do you think ? Regards, |
Thanks for the updated information! Having an outdated config file would definitely explain a piece of this. However, we do check for your local version of I know you've installed yarn now, so it might not be possible, but I'd be curious what the result of |
I was using the latest package from yarn deb repository (https://dl.yarnpkg.com/debian/ stable main) which seems to be v 1.22.5 ATM. Dunno if that helps |
For the record. If I set cli.packageManager to yarn in my ~/.config/gatsby/config.json I can reproduce. |
Thanks @laurieontech , I did test your fix, it doesn't work. I think I found the bug and the fix just let me 5 sec to test and push a PR ^^ |
Fixes #27338 Steps to reproduce : 1. Uninstall yarn 2. Verify that PackageManager is setted to 'yarn' in config.json 3. Run gatsby-cli new It failed with ``` ERROR Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT Error: Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT - child_process.js:268 Process.ChildProcess._handle.onexit internal/child_process.js:268:19 - child_process.js:464 onErrorNT internal/child_process.js:464:16 - task_queues.js:80 processTicksAndRejections internal/process/task_queues.js:80:21 ```
Fixes gatsbyjs/gatsby#27338 Steps to reproduce : 1. Uninstall yarn 2. Verify that PackageManager is setted to 'yarn' in config.json 3. Run gatsby-cli new It failed with ``` ERROR Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT Error: Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT - child_process.js:268 Process.ChildProcess._handle.onexit internal/child_process.js:268:19 - child_process.js:464 onErrorNT internal/child_process.js:464:16 - task_queues.js:80 processTicksAndRejections internal/process/task_queues.js:80:21 ```
Fixes gatsbyjs/gatsby#27338 Steps to reproduce : 1. Uninstall yarn 2. Verify that PackageManager is setted to 'yarn' in config.json 3. Run gatsby-cli new It failed with ``` ERROR Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT Error: Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT - child_process.js:268 Process.ChildProcess._handle.onexit internal/child_process.js:268:19 - child_process.js:464 onErrorNT internal/child_process.js:464:16 - task_queues.js:80 processTicksAndRejections internal/process/task_queues.js:80:21 ```
Fixes gatsbyjs/gatsby#27338 Steps to reproduce : 1. Uninstall yarn 2. Verify that PackageManager is setted to 'yarn' in config.json 3. Run gatsby-cli new It failed with ``` ERROR Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT Error: Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT - child_process.js:268 Process.ChildProcess._handle.onexit internal/child_process.js:268:19 - child_process.js:464 onErrorNT internal/child_process.js:464:16 - task_queues.js:80 processTicksAndRejections internal/process/task_queues.js:80:21 ```
Fixes gatsbyjs/gatsby#27338 Steps to reproduce : 1. Uninstall yarn 2. Verify that PackageManager is setted to 'yarn' in config.json 3. Run gatsby-cli new It failed with ``` ERROR Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT Error: Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT - child_process.js:268 Process.ChildProcess._handle.onexit internal/child_process.js:268:19 - child_process.js:464 onErrorNT internal/child_process.js:464:16 - task_queues.js:80 processTicksAndRejections internal/process/task_queues.js:80:21 ```
Fixes gatsbyjs/gatsby#27338 Steps to reproduce : 1. Uninstall yarn 2. Verify that PackageManager is setted to 'yarn' in config.json 3. Run gatsby-cli new It failed with ``` ERROR Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT Error: Command failed with ENOENT: yarnpkg spawn yarnpkg ENOENT - child_process.js:268 Process.ChildProcess._handle.onexit internal/child_process.js:268:19 - child_process.js:464 onErrorNT internal/child_process.js:464:16 - task_queues.js:80 processTicksAndRejections internal/process/task_queues.js:80:21 ```
Summary
While following the tutorial I got an error because yarn is necessary but isn't listed as needing to be installed
Motivation
This doesn't help being reassured at using gatsby if the basically first step of getting to know it ends up in errors ...
Steps to resolve this issue
After installing yarn with
npm install -i yarn
problem is solvedDraft the doc
I don't know where the information should be placed but perhaps modifying the Set default Node.js version chapter to include the yarn installation could do it.
Let me know if that's OK and I'll make a PR
Regards,
Nicolas
The text was updated successfully, but these errors were encountered: