无法安装我的npm package.json

时间:2017-09-06 19:37:09

标签: npm npm-install package.json

我正努力安装package.json

我删除了我的node_modules文件夹并尝试重新安装所有内容

我收到错误



npm WARN deprecated fs-promise@1.0.0: Use mz or fs-extra^3.0 with Promise Support
npm ERR! code 1
npm ERR! Command failed: /usr/bin/git clone --depth=1 -q -b master https://github.com/jlongster/ast-types.git /Users/.npm/_cacache/tmp/git-clone-1000c12c
npm ERR! /Users/.npm/_cacache/tmp/git-clone-1000c12c/.git: Permission denied
npm ERR! 

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/.npm/_logs/2017-09-06T19_29_56_831Z-debug.log




我尝试通常使用-- force清除缓存,但它没有帮助。

感谢。

1 个答案:

答案 0 :(得分:0)

因为有一个\Users文件夹,你可能在Mac上。通常.npm文件夹位于用户文件夹内,例如/Users/username/.npm

您可能会在$HOME目录中找到一个:

ls -la ~

如果您运行此命令:

/usr/bin/git clone --depth=1 -q -b master https://github.com/jlongster/ast-types.git /Users/.npm/_cacache/tmp/git-clone-1000c12c

添加了<username>后,它应该有效:

/usr/bin/git clone --depth=1 -q -b master https://github.com/jlongster/ast-types.git /Users/<username>/.npm/_cacache/tmp/git-clone-1000c12c

你的package.json中的某个地方有一个包,取决于这个git repo。日志文件应该有更多线索:

locate 2017-09-06T19_29_56_831Z-debug.log | xargs cat
相关问题