gpt4 book ai didi

node.js - npm 安装 Angular/CLI 错误

转载 作者:太空宇宙 更新时间:2023-11-03 22:45:51 24 4
gpt4 key购买 nike

node -v 8 和 npm -v 5。尝试从昨天开始在全局范围内安装 angular/cli 。每次都会遇到新的错误。

Vipins-Air:~ vipingupta$ sudo npm install -g @angular/cli npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! network request to http://registry.npmjs.org/@angular%2fcli failed, reason: connect ETIMEDOUT 74.122.238.10:8080 npm ERR! network This is a problem related to network connectivity. npm ERR! network In most cases you are behind a proxy or have bad network settings. 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! A complete log of this run can be found in: npm ERR! /Users/vipingupta/C:Devnodejsnpm-cache/_logs/2017-06-07T06_37_13_337Z-debug.log

最佳答案

如果您收到以下消息:

npm ERR! network 'proxy' config is set properly. See: 'npm help config'

您需要设置代理

$ npm config set proxy http://XXX.XXX.XXX.XXX:XXXX

$ npm config set https-proxy http://XXX.XXX.XXX.XXX:XXXX

给出您的代理IP地址和端口号(4位)

如果您不想使用代理,请使用以下命令将其删除

$ npm config rm proxy   
$ npm config rm https-proxy

检查当前代理

$ npm config get proxy

关于node.js - npm 安装 Angular/CLI 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44405323/

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