npm 更新检查失败 [英] npm update check failed
问题描述
昨晚我尝试更新我的节点和 npm,它似乎成功了,但是从那以后,我每次尝试运行任何 npm 命令时都会遇到同样的错误.
Last night I tried to update my node and npm, it seemed to have been successful, however ever since then I have been getting this same error any time I try and run any npm command.
我尝试卸载并重新安装 npm,但无法通过下面的错误消息.
I have tried uninstalling and re-installing npm, but cannot get past this error message below.
节点版本:v8.3.0
Node version: v8.3.0
我收到的错误消息:
┌───────────────────────────────────────────────────────────────────┐
│ npm update check failed │
│ Try running with sudo or get access │
│ to the local update config store via │
│ sudo chown -R $USER:$(id -gn $USER) /Users/veritystothard/.config │
└───────────────────────────────────────────────────────────────────┘
module.js:491
throw err;
^
Error: Cannot find module 'proto-list'
at Function.Module._resolveFilename (module.js:489:15)
at Function.Module._load (module.js:439:25)
at Module.require (module.js:517:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/config-chain/index.js:1:79)
at Module._compile (module.js:573:30)
at Object.Module._extensions..js (module.js:584:10)
at Module.load (module.js:507:32)
at tryModuleLoad (module.js:470:12)
at Function.Module._load (module.js:462:3)
我不确定这里要包含哪些其他详细信息,如果有人遇到此问题,我将不胜感激.谢谢!
I'm not sure what other details to include here, if anyone has had this issue before I'd appreciate your help. Thanks!
推荐答案
以下是来自 github 的答案
修复 Windows,我收到此消息:
Fix for windows, I got this message :
npm 更新检查失败 尝试使用 sudo 运行或访问通过 sudo chown -R $USER:$(id -gn $USER) 本地更新配置存储C:Users.config
npm update check failed Try running with sudo or get access to the local update config store via sudo chown -R $USER:$(id -gn $USER) C:Users.config
所以我继续到 C:Users.config 并删除了配置存储"文件夹.一旦我这样做了,下次运行 npm start 时,文件夹重新生成,错误停止
so I went on to C:Users.config and deleted the "configstore" folder. once I done this, next time a ran npm start, the folder was re-generated, and error stopped
针对 OSX 的修复:
Fix for OSX:
经过两个小时的尝试和失败,我设法解决了以下问题:
After two hours of try-and-fail I managed to solve the issue as follows:
- 转到文件夹/usr/local/lib/node_modules/
- 右键单击文件夹 node_modules >去获取信息
- 更新权限>添加您自己和管理员帐户并设置读写"对于两者
- 在终端运行npm install packageName"
- 如果仍然出现错误,请转到同一文件夹/usr/local/lib/node_modules/并在文件夹 node_modules 中,以相同方式更新新包文件夹的权限
- 尝试在终端中再次运行npm install packageName"
这对我有用!希望它可以帮助某人.
That worked for me! Hope it could help somebody.
这篇关于npm 更新检查失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!