My operating system: OSX 10.12.6
I followed the instructions on the main website on how to set up a react-strap project.
I get the following output when trying to run: yarn start
Kyles-MacBook-Pro:sandbox1 kyle$ yarn start
yarn run v1.3.2
$ react-scripts start
/bin/sh: react-scripts: command not found
error Command failed with exit code 127.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
Did you install first?
Nope. sorry about this
i did npm install and it worked fine
Haha. This is the top google result for "yarn exit code 127" and super helpful. Thanks, peoples!
I mean seriously? How I missed this part? 😄 just run yarn and it's fixed 🤦♂️ 🎉
Really helpful! Thank you!
For those of you who face the issue even after running yarn install, for me it was some remaining files in the node_modules folder. Getting rid of the node_modules folder entirely (rm -rf node_modules from the root folder), then running yarn install resolved this for me.
I'm teaching a class right now and running into this issue a lot, also ran into it on my own just now. I believe the issue me and the students were having was that one of the parent directories that the React project is in has a space in its name. If any of the directories above the project have a space in their name, then yarn install doesn't solve this error. Once I renamed the directories to not have spaces, the thing worked.
Edit: Here's my dependency list in package.json, in case you need it for details:
"dependencies": {
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "^3.0.1"
},
@sentientouroboros Have you tried just the "Yarn" command by itself? After browsing for about 30 minutes through the doc and trying different stuff it just kind of worked haha
Sorry for the lack of insight I am still kinda new to this.
I've delete directory node_module, after run yarn install && yarn start and it's fixed.
nothing of above working for me!! :(
world is beautiful.
Following @TheMshary thought process, I apparently had a colon in a parent directory a few levels up. Changing that directory name did it for me.
@TheMshary Thank you so much! It worked for me
worked for me after running just the command yarn in project folder
Remember to bind /node_modules to volume if you bind volume rest of the project.
Mine oh mine! This forum is so helpful.My parent directory has space also, yarn install, npm install an all the other tricks weren't working for me.Changed the directory and boom,back on track. No space in naming folders pls.
I forgot to install pretty-quick as I was using it to format code using prettier.
"format:precommit": "pretty-quick --staged --pattern \"src/**/*.*(js|jsx|ts|tsx)\""
i did npm install and it worked fine
All things well done! Just install yarn globally, then install yarn in project using yarn install ang yarn start
npm install -g concurrently
it worked fine .thanks beautiful people
Fased this problem on my Macbook 13 pro 2018 BigSur 11.2
The problem dissapear after i change directory of my project, and then reinstall _node_modules_.
I moved project from folder with _.nosync_ ending, to my desktop. Think that _.nosync_ cause problem in my case(i just wanted to disable sync projects, becouse of node_modules, maybe someone know how to do not sync them to icloud in other way?)
Most helpful comment
Did you install first?