Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does "yarn install" raise an ENOENT error when installing esparse?

Tags:

npm

yarnpkg

I have a JavaScript project using npm to manage its dependencies. I'm trying to migrate to Yarn.

When I run yarn install in the console, it gives me an error:

An unexpected error occurred: "ENOENT: no such file or directory, chmod C:\....\node_modules\.bin\esparse"

From what I read on the yarn docs, just running yarn install should be enough. Why doesn't this work as expected?

I am using Yarn 0.17.0, npm 2.14.12 and Node 4.2.4.

like image 631
daniely Avatar asked Nov 14 '16 22:11

daniely


People also ask

Does yarn install generate a lock file?

Whenever you run yarn (which is the equivalent of running yarn install ) upon a fresh install, a yarn. lock file is generated. It lists the versions of dependencies that are used at the time of the installation process. That means it looks into your package.

Can I use yarn install instead of npm install?

Yarn can consume the same package. json format as npm, and can install any package from the npm registry. This will lay out your node_modules folder using Yarn's resolution algorithm that is compatible with the node. js module resolution algorithm.

What happens when you run yarn install?

yarn install is used to install all dependencies for a project. This is most commonly used when you have just checked out code for a project, or when another developer on the project has added a new dependency that you need to pick up. If you are used to using npm you might be expecting to use --save or --save-dev .

Should I install yarn through npm?

The Yarn maintainers recommend installing Yarn globally by using the NPM package manager, which is included by default with all Node. js installations. Use the -g flag with npm install to do this: sudo npm install -g yarn.


1 Answers

The following Solution worked for me

rm -rf node_modules **/node_modules
rm -rf yarn.lock **/yarn.lock
yarn cache clean
yarn install
like image 125
Saransh Avatar answered Oct 10 '22 18:10

Saransh