gpt4 book ai didi

angularjs - npm 无法安装 angular-cli

转载 作者:搜寻专家 更新时间:2023-11-01 00:16:58 25 4
gpt4 key购买 nike

我正在尝试通过 npm 安装 angular-cli。我安装了最新版本的 Nodejs 和 git。我不支持任何代理服务器(通过 netsh winhttp show proxy 以及通过 Internet Explorer LAN 设置验证)并且我的互联网连接没有问题。当我尝试运行时

npm install -g angular-cli 然后我得到以下错误

C:\Windows\system32>npm install -g angular-cli
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" "-g" "angular-cli"
npm ERR! node v7.3.0
npm ERR! npm v3.10.10
npm ERR! code ETIMEDOUT
npm ERR! errno ETIMEDOUT
npm ERR! syscall connect

npm ERR! network connect ETIMEDOUT 151.101.192.162:80
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! C:\Windows\system32\npm-debug.log

我尝试通过 npm cache clean 清理缓存,还尝试通过

将注册表更改为 http:\
npm config set registry http://registry.npmjs.org/

我也尝试卸载 nodejs 并再次重新安装,但它不起作用。我遇到了同样的错误。任何想法。

最佳答案

Setp-1: 打开 windows 命令提示符,然后输入以下命令以获取代理服务器的 IP 地址

ping your-proxy-name

例如:

ping myproxy.xyz.com

第 2 步:打开 Node.js 命令提示符并键入以下命令

npm config set http-proxy http://your-proxy-ip-retrieved-in-step-1:port
npm config set https-proxy http://your-proxy-ip-retrieved-in-step-1:port

例如:

npm config set http-proxy http://192.168.192.95:8080
npm config set https-proxy http://192.168.192.95:8080

Setp-3:在 Node.js 命令提示符下键入以下命令来安装 angular

npm install -g @angular/cli

希望它对你有用。

关于angularjs - npm 无法安装 angular-cli,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41280429/

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