Reputation: 173
npm WARN tar ENOENT: no such file or directory, open 'C:{{File_Location}}\node_modules.staging\mocha-20835964\lib\browser\progress.js'
and Error message as npm ERR! Unexpected end of JSON input while parsing near '...int-stylish":"~0.1.3"'
I am trying the command npm-install in visual studio above is the error which I am getting.Please help me for the same.
Upvotes: 13
Views: 20061
Reputation: 1976
delete package-lock.json
first.
navigate to the root folder of your project and npm cache clean --force
, then try npm install
Upvotes: 16
Reputation: 31625
What happen for me to get this error was when I runned npm i
and closed or stopped before it was finished. Then to try to "fix" it, I deleted the node_modules
folder and runned npm i
again and started getting this error.
And the reason why this happens and npm cache clean --force
fixes the problem is that npm have a cache on the files that it have already downloaded, but when I remove node_modules
, it can't find the files name that are cached and should be in the node_modules
and gives this error/warning.
Upvotes: 1
Reputation: 33994
To install any dependency using npm is
npm install module_name
For eg
npm install path or npm i path
But not
npm-install path or npm-install
Upvotes: -3