gpt4 book ai didi

node.js - npm 更新检查失败

转载 作者:IT老高 更新时间:2023-10-28 23:00:50 27 4
gpt4 key购买 nike

昨晚我尝试更新我的 Node 和 npm,它似乎已经成功,但是从那以后,每当我尝试运行任何 npm 命令时,我都会遇到同样的错误。

我已尝试卸载并重新安装 npm,但无法通过下面的此错误消息。

Node 版本: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)

如果有人遇到此问题,我不知道在此包含哪些其他详细信息,我将不胜感激您的帮助。谢谢!

最佳答案

以下是来自 github 的答案

Fix for windows, I got this message :

npm update check failed Try running with sudo or get access to thelocal 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, thefolder was re-generated, and error stopped

修复 OSX:

经过两个小时的尝试和失败,我设法解决了以下问题:

  1. 转到文件夹/usr/local/lib/node_modules/
  2. 右键单击文件夹 node_modules > 转到获取信息
  3. 更新权限 > 添加您自己和管理员帐户并为两者设置“读写”
  4. 在终端“npm install packageName”中运行
  5. 如果仍然出现错误,请转到同一文件夹/usr/local/lib/node_modules/并在文件夹 node_modules 中,以相同的方式更新新包文件夹的权限
  6. 尝试在终端“npm install packageName”中再次运行

这对我有用!希望它可以帮助某人。

关于node.js - npm 更新检查失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45650300/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com