【发布时间】: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
但是,它仍然显示相同的错误。
【问题讨论】:
-
@MukeshSharma:请看我的更新
标签: android node.js npm gruntjs npm-install