【问题标题】:'npm update check failed' on W10, no .config file existsW10 上的“npm 更新检查失败”,不存在 .config 文件
【发布时间】:2018-09-08 13:22:27
【问题描述】:

我在 Windows 10 上。每当我执行 npm 命令(版本 5.8.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) C:\Users\<my user folder>\.config

现在我很乐意研究 .config 的权限问题,但是:

  • 我在管理员模式下运行 cmd
  • 我没有任何 .config 任何地方

你会如何解决这个问题?谢谢。

【问题讨论】:

    标签: node.js npm


    【解决方案1】:

    我已经在 C:\Users\&lt;username&gt;\ 中有一个 .config 文件,它阻止了 npm 创建自己的 .config 文件。 删除 .config 文件为我解决了这个问题。

    【讨论】:

      【解决方案2】:

      首先卸载 nodejs 并再次安装 nodejs anf 仍然如果问题没有消失,请按照以下步骤操作

      现在转到 C:\Users\vishwajeet.config\configstore`(这里 'vishwajeet' 是我的帐户名)

      \configstore中,会有update-notifier-npm的json文件。用任意编辑器打开这个文件,如果能看到如下数据:

      { “选择退出”:假, “上次更新检查”:1552087604401 }

      如果optOut 的值为“false”,则将其替换为“true”。这将消除 npm update check failed 的错误!

      【讨论】:

        猜你喜欢
        • 2018-01-20
        • 1970-01-01
        • 2020-04-04
        • 2017-06-19
        • 1970-01-01
        • 2017-11-02
        • 1970-01-01
        • 1970-01-01
        • 2022-10-07
        相关资源
        最近更新 更多