npm安装错误/问题 [英] npm install error/issue

查看:1084
本文介绍了npm安装错误/问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在.npmrc文件中设置了代理配置。
执行npm install命令会给出如下错误

I have already set proxy configurations in .npmrc file. Executing the npm install command gives me error as follows"


$ npm install npm ERR!Windows_NT 6.1.7601 npm ERR! argvC:\Program
Files \\\
odejs\\\
ode.exeC:\Program
Files \\\
odejs \\\
ode_modules \ npm \ bin \ nnpm-cli。 jsinstallnpm ERR!
node v6.9.4 npm ERR!npm v3.10.10 npm ERR!code ECONNRESET

$ npm install 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 ERR! node v6.9.4 npm ERR! npm v3.10.10 npm ERR! code ECONNRESET

npm ERR!网络隧道套接字可能没有建立,
statusCode = 400 npm ERR!network这很可能不是
npm本身的问题npm ERR!network并且与网络连接有关。
npm ERR!network在大多数情况下你是代理服务器或者网络设置不好的情况.npm ERR!network npm ERR!network如果你在
a代理后面,请确保npm ERR!network'proxy'配置为
设置正确。请参阅:'npm help config'

npm ERR! network tunneling socket could not be established, statusCode=400 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 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!请包含以下文件以及任何支持请求est:
npm ERR!D:\ Pooja \quickstart \\\
pm-debug.log

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

.npmrc用户文件夹中的文件包含以下值

The .npmrc file in user folder contains following values

 1. registry=https://registry.npmjs.org/
 2. proxy=http://proxy@domain.com:8080/
 3. http_proxy=http://username:password@proxy@domain.com:8080/

有什么方法可以解决这个问题吗?

Is there any way to solve this issue?

推荐答案

您的代理网址中是否包含@符号? @符号将用户ID和密码与URL分开。如果是,您可以尝试使用'%40'来替换它。

Does your proxy URL have '@' symbol in it? @ symbol separates the user ID and password from the URL. If it does, you can try using '%40' to replace it.

此外,它是https-proxy而不是http_proxy。

Also, it is https-proxy not http_proxy.

正确的配置看起来像 -

A correct config would look like -

registry=https://registry.npmjs.org/
proxy=http://username:password@proxydomain:8080/
https-proxy=https://username:password@proxydomain:8080/

https:// docs。 npmjs.com/misc/config#proxy

这篇关于npm安装错误/问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆