在做npm安装时收到错误"没有打开这样的文件或目录"

Pra*_*ank 8 node.js npm

npm WARN tar ENOENT:没有这样的文件或目录,打开'C:{{File_Location}} \node_modules.staging\mocha-20835964\lib\browser\progress.js'

和错误消息为npm ERR!解析'... int-stylish'附近的JSON输入意外结束:"~0.1.3"'

我在上面的visual studio中尝试命令npm-install是我得到的错误.请帮我一样.

Mil*_*adi 13

package-lock.json先删除.导航到项目的根文件夹npm cache --force clean,然后尝试npm install


Hem*_*ari -3

使用 npm 安装任何依赖项是

  npm install module_name 
Run Code Online (Sandbox Code Playgroud)

例如

  npm install path or npm i path
Run Code Online (Sandbox Code Playgroud)

但不是

 npm-install path or npm-install
Run Code Online (Sandbox Code Playgroud)