While doing npm install getting an error as “No su

2020-04-03 09:54发布

问题:

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.

回答1:

delete package-lock.json first. navigate to the root folder of your project and npm cache --force clean, then try npm install



回答2:

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


标签: node.js npm