【问题标题】:npm error when installing grunt/latest versions安装 grunt/最新版本时出现 npm 错误
【发布时间】:2016-10-13 18:55:21
【问题描述】:

npm 升级到 最新版本 或使用命令提示符安装 grunt 时,出现以下异常。

C:\Users\username>npm install npm@latest
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\
node_modules\\npm\\bin\\npm-cli.js" "install" "npm@latest"
npm ERR! node v4.4.5
npm ERR! npm  v2.15.5
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT 103.245.222.162:443
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settin
gs.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     D:\Users\username\npm-debug.log

我尝试了以下命令来安装最新版本的 npm

npm install npm@latest

以及用于安装 grunt

npm install -g grunt-cli

对于两者,我都遇到了上述错误。谁能帮我解决这个问题。

更新:

我尝试了以下方法。我已经配置了代理地址,然后尝试安装grunt。

对于 HTTP:

npm config set proxy http://proxy_host:port

对于 HTTPS:

npm config set https-proxy http://proxy.company.com:8080

但是,它仍然显示相同的错误。

【问题讨论】:

标签: android node.js npm gruntjs npm-install


【解决方案1】:

这个解决了我一个问题。

npm config set registry "http://registry.npmjs.org/"  

然后,安装了 grunt 并且成功了!

【讨论】:

    猜你喜欢
    • 2013-02-19
    • 2021-06-24
    • 2015-01-15
    • 2022-06-26
    • 1970-01-01
    • 2018-06-03
    • 2022-07-25
    • 2015-07-08
    • 2015-04-27
    相关资源
    最近更新 更多