Reputation: 181
I installed yarn using the following command
npm install yarn -g
Then it shows the following status:
> [email protected] preinstall C:\Users\vdine\AppData\Roaming\npm\node_modules\yarn
> :; (node ./preinstall.js > /dev/null 2>&1 || true)
C:\Users\vdine\AppData\Roaming\npm\yarn -> C:\Users\vdine\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
C:\Users\vdine\AppData\Roaming\npm\yarnpkg -> C:\Users\vdine\AppData\Roaming\npm\node_modules\yarn\bin\yarn.js
+ [email protected]
added 1 package in 0.962s
Then I added the yarn path to the environment variable
C:\Users\**path**\AppData\Roaming\npm\node_modules\yarn\bin
but its still shows "'yarn' is not recognized as an internal or external command, operable program or batch file."
What should I do now?
Upvotes: 18
Views: 52912
Reputation: 51
remove file C:\Users\vdine\AppData\Roaming\npm\node_modules\yarn
and run npm install -g yarn --force
Upvotes: 3
Reputation: 8805
The recommended method for installation Yarn is now via npm:
npm install --global yarn
https://classic.yarnpkg.com/en/docs/install/
Try adding C:\Users\vdine\AppData\Roaming\npm
to your PATH environment variable instead of C:\Users\**path**\AppData\Roaming\npm\node_modules\yarn\bin
The recommended method for installing Yarn is your OS tools instead of npm, check out the MSI method:
Upvotes: 31