error Command failed with exit code 1. when I try to run yarn
Solution 1:
what you need to do is just simple: follow these steps:
- rm -rf node_modules
- yarn cache clean
- yarn
- yarn start
Solution 2:
I faced same error and I fixed it by following these steps:
- Delete
yarn_lock.json
orrm -rf yarn_lock.json
(if you are Linux/MacOS user) - Delete
node_modules/
orrm -rf node_modules/
(if you are Linux/MacOS user) - Follow the instructions to install the latest Yarn package available from here
- Try executing following commands in your project root folder:
yarn install
andyarn start
In case if the above approach didn't help:
- Try to install latest node.js
- Remove
node_modules/
andlock
file - use
npm install
andnpm run-script
Solution 3:
One of the issue that you may face is the server won't start if some other server is running too . For eg. I had XAMP Running and thus my yarn couldn't start itself. Check it once.
Solution 4:
This should work:
yarn add yarn