node.js npm 更新检查失败
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/45650300/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
npm update check failed
提问by VStothard
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,它似乎成功了,但是从那以后,每当我尝试运行任何 npm 命令时,我都会遇到同样的错误。
I have tried uninstalling and re-installing npm, but cannot get past this error message below.
我尝试卸载并重新安装 npm,但无法通过下面的错误消息。
Node version: v8.3.0
节点版本:v8.3.0
Error message I am getting:
我收到的错误消息:
┌───────────────────────────────────────────────────────────────────┐
│ 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!
我不确定这里要包含哪些其他详细信息,如果有人在我感谢您的帮助之前遇到过这个问题。谢谢!
回答by isntn
Following is the answer from github
以下是来自github的回答
Fix for windows, I got this message :
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
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
修复 Windows,我收到此消息:
npm 更新检查失败尝试使用 sudo 运行或通过 sudo chown -R $USER:$(id -gn $USER) C:\Users.config 访问本地更新配置存储
所以我继续到 C:\Users.config 并删除了“configstore”文件夹。完成此操作后,下次运行 npm start 时,将重新生成该文件夹,并停止错误
回答by Fa Rid
If your are on macOS, you must update the config file. You just have to enter this command in your terminal:
如果您使用的是 macOS,则必须更新配置文件。您只需要在终端中输入此命令:
sudo npm i -g npm
回答by NadZ
I had the same issue on AWS server, i used this command to update the config permissions and the npm command worked smooth.
我在 AWS 服务器上遇到了同样的问题,我使用此命令更新了配置权限,并且 npm 命令运行顺利。
sudo chown -R $USER:$(id -gn $USER) ~/.config
须藤 chown -R $USER:$(id -gn $USER) ~/.config
回答by Sergey Pavlov
I have similar error after node updating so i just delete directory .configand this help.
节点更新后我有类似的错误,所以我只是删除目录.config和这个帮助。
回答by Abdullah Pariyani
回答by Stefan
If you don't want to chown your entire .configdirectory (which contains configuration files from other programs), try:
如果您不想 chown 整个.config目录(其中包含来自其他程序的配置文件),请尝试:
sudo chown -R $USER:$(id -gn $USER) "/home/skaestle/.config/configstore/"
回答by RH Blanchfield
I have a fixed that worked for me on OSX Catalina:
我有一个在 OSX Catalina 上对我有用的修复:
-------------------------------------
/var/log/nodejs/nodejs.log
-------------------------------------
> node server.js
a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”
a”? npm update check failed a”?
a”? Try running with sudo or get access a”?
a”? to the local update config store via a”?
a”? sudo chown -R $USER:$(id -gn $USER) /tmp/.config a”?
a””a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”a”
I ran the following code in the terminal and as suggested here: sudo chown -R $USER:$(id -gn $USER) /tmp/.config& redeployed to my instance which still showed a degraded state.
我在终端中运行了以下代码,并按照此处的建议:sudo chown -R $USER:$(id -gn $USER) /tmp/.config& 重新部署到我的实例,该实例仍然显示降级状态。
I did this several times and this did not result in success.
我这样做了几次,但这并没有成功。
Since I had a duplicate instance that was in the ready, so I didn't think it was a permissions problem on my local machine.
由于我有一个准备好的重复实例,所以我认为这不是我本地机器上的权限问题。
The following fix worked for me (please note that my code is deployed to ebs through AWS CodePipeline":
以下修复对我有用(请注意,我的代码已通过 AWS CodePipeline 部署到 ebs”:
- Delete
package-lock.jsonfrom your express/node project.- Run
npm igit add && git commit -m "your commit msg" && git push
package-lock.json从您的 express/node 项目中删除。- 跑
npm igit add && git commit -m "your commit msg" && git push
In your aws console, go to code pipelineand verify your code deployed successfully.
在您的 aws 控制台中,转到代码管道并验证您的代码已成功部署。
Navigate to Elastic Beanstalk. If your code pushed successfully, you should see your instance updating.
导航到Elastic Beanstalk。如果您的代码推送成功,您应该会看到您的实例正在更新。
After this the state of your EBS environment should be in the ready state.
在此之后,您的 EBS 环境的状态应处于就绪状态。
Hope this helps someone out.
希望这可以帮助某人。
回答by justanotherITguy
I had the same error (npm update check failed) on a Centos 7 but not when installing node, just when loggin into the server and it was because there was no more space left. Deleted some files, updated the system and everything worked fine again.
我在 Centos 7 上遇到了同样的错误(npm 更新检查失败),但在安装节点时没有,只是在登录服务器时出现,这是因为没有更多空间了。删除了一些文件,更新了系统,一切又正常了。
Just in case somebody else comes to the same problem.
以防万一其他人遇到同样的问题。
回答by Thirumalai murugan
Try running the command prompt Run as administratormode, if that not solved your issue delete the .configfolder under c:\user\<name of the user>\and then try running the command prompt Run as administratormode.
尝试运行命令提示符 Run as administrator模式,如果还没有解决您的问题,请删除下面的.config文件夹c:\user\<name of the user>\,然后尝试运行命令提示符Run as administrator模式。
回答by Al-Mothafar
I got a Windows 10 environment:
我有一个 Windows 10 环境:
For me, first I did make sure all node.exe instances killed:
对我来说,首先我确实确保所有 node.exe 实例都被杀死:
taskkill /t /f /im node.exe
Then I've updated npm to the latest version using npm-check-updates
然后我使用npm-check-updates将npm更新到最新版本
Finally, I deleted .configfolder from user home C:\Users\<USERNAME>
最后,我.config从用户家中删除了文件夹C:\Users\<USERNAME>
That's solved my problem.
这解决了我的问题。


