npm install命令不能与代理一起使用

时间:2022-03-17 16:05:11

I need to install angular cli in my windows system.But whenvever i try to install it using the npm install command i am getting an error.I am using a proxy network of my college.i have atttched the scren shot here

我需要在我的windows系统中安装angular cli。但是当我尝试使用npm install命令安装它时,我收到一个错误。我正在使用我的学院的代理网络。我已经在这里抓住了scren

5 个解决方案

#1


1  

Try below steps

尝试以下步骤

  1. npm config set strict-ssl false
  2. npm config set strict-ssl false

Then set npm to run with http, instead of https:

然后将npm设置为使用http而不是https运行:

  1. npm config set registry "http://registry.npmjs.org/"
  2. npm config set registry“http://registry.npmjs.org/”

Then I install packages using this syntax:

然后我使用以下语法安装包:

  1. npm --proxy http://username:password@cacheaddress.com.br:80 \ install packagename
  2. npm --proxy http://用户名:password@cacheaddress.com.br:80 \ install packagename

Skip the username:password part if proxy doesn't require you to authenticate

如果代理不要求您进行身份验证,请跳过用户名:密码部分

You may get NPM to work behind a proxy by setting BOTH HTTP_PROXY and HTTPS_PROXY environment variables, then issuing normally the command npm install express (for example)

您可以通过设置BOTH HTTP_PROXY和HTTPS_PROXY环境变量让NPM在代理后面工作,然后正常发出命令npm install express(例如)

To know more about running npm command behind corporate proxy click here

要了解有关在公司代理后面运行npm命令的更多信息,请单击此

#2


0  

Use npm proxy settings like this :

使用这样的npm代理设置:

Http: $ npm config set proxy http://<username>:<password>@<proxy-server-url>:<port>

Http:$ npm config set proxy http:// <用户名> : <密码> @

Https: $ npm config set https-proxy http://<username>:<password>@<proxy-server-url>:<port>

Https:$ npm config set https-proxy http:// @

#3


0  

try to set proxy to your npm

尝试将代理设置为你的npm

npm config set proxy http://"username:password"@yourdomain:port
npm config set https-proxy http://"username:password"@yourdomain:port
npm config set registry=http://registry.npmjs.org/
npm config set strict-ssl=false 

#4


0  

The Systems that are all present inside the corporate proxy requires npm proxy setup separately.

公司代理中存在的系统需要单独进行npm代理设置。

npm uses a configuration file (.npmrc file) to apply the proxy setting, which can be modified through command prompt.

npm使用配置文件(.npmrc文件)来应用代理设置,可以通过命令提示符进行修改。

try to set proxy first something like this:

尝试先设置代理,如下所示:

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

Run the commands in command prompt one by one.

在命令提示符下逐个运行命令。

Hope it helps :)

希望能帮助到你 :)

#5


0  

run those commands as:

将这些命令运行为:

1 .npm config set strict-ssl false Then set npm to run with http, instead of https:

1 .npm config set strict-ssl false然后将npm设置为使用http而不是https运行:

2 . npm config set registry "http://registry.npmjs.org/" Then I install packages using this syntax:

2。 npm config set registry“http://registry.npmjs.org/”然后我使用以下语法安装包:

  1. npm --proxy http://username:password@cacheaddress.com.br:80 \ install packagename Skip the username:password part if proxy doesn't require you to authenticate

    npm --proxy http://用户名:password@cacheaddress.com.br:80 \ install packagename如果代理不要求您进行身份验证,请跳过用户名:密码部分

    You may get NPM to work behind a proxy by setting BOTH HTTP_PROXY and HTTPS_PROXY environment variables, then issuing normally the command npm install express

    您可以通过设置BOTH HTTP_PROXY和HTTPS_PROXY环境变量让NPM在代理后面工作,然后正常发出命令npm install express

Good Luck

祝你好运

#1


1  

Try below steps

尝试以下步骤

  1. npm config set strict-ssl false
  2. npm config set strict-ssl false

Then set npm to run with http, instead of https:

然后将npm设置为使用http而不是https运行:

  1. npm config set registry "http://registry.npmjs.org/"
  2. npm config set registry“http://registry.npmjs.org/”

Then I install packages using this syntax:

然后我使用以下语法安装包:

  1. npm --proxy http://username:password@cacheaddress.com.br:80 \ install packagename
  2. npm --proxy http://用户名:password@cacheaddress.com.br:80 \ install packagename

Skip the username:password part if proxy doesn't require you to authenticate

如果代理不要求您进行身份验证,请跳过用户名:密码部分

You may get NPM to work behind a proxy by setting BOTH HTTP_PROXY and HTTPS_PROXY environment variables, then issuing normally the command npm install express (for example)

您可以通过设置BOTH HTTP_PROXY和HTTPS_PROXY环境变量让NPM在代理后面工作,然后正常发出命令npm install express(例如)

To know more about running npm command behind corporate proxy click here

要了解有关在公司代理后面运行npm命令的更多信息,请单击此

#2


0  

Use npm proxy settings like this :

使用这样的npm代理设置:

Http: $ npm config set proxy http://<username>:<password>@<proxy-server-url>:<port>

Http:$ npm config set proxy http:// <用户名> : <密码> @

Https: $ npm config set https-proxy http://<username>:<password>@<proxy-server-url>:<port>

Https:$ npm config set https-proxy http:// @

#3


0  

try to set proxy to your npm

尝试将代理设置为你的npm

npm config set proxy http://"username:password"@yourdomain:port
npm config set https-proxy http://"username:password"@yourdomain:port
npm config set registry=http://registry.npmjs.org/
npm config set strict-ssl=false 

#4


0  

The Systems that are all present inside the corporate proxy requires npm proxy setup separately.

公司代理中存在的系统需要单独进行npm代理设置。

npm uses a configuration file (.npmrc file) to apply the proxy setting, which can be modified through command prompt.

npm使用配置文件(.npmrc文件)来应用代理设置,可以通过命令提示符进行修改。

try to set proxy first something like this:

尝试先设置代理,如下所示:

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

Run the commands in command prompt one by one.

在命令提示符下逐个运行命令。

Hope it helps :)

希望能帮助到你 :)

#5


0  

run those commands as:

将这些命令运行为:

1 .npm config set strict-ssl false Then set npm to run with http, instead of https:

1 .npm config set strict-ssl false然后将npm设置为使用http而不是https运行:

2 . npm config set registry "http://registry.npmjs.org/" Then I install packages using this syntax:

2。 npm config set registry“http://registry.npmjs.org/”然后我使用以下语法安装包:

  1. npm --proxy http://username:password@cacheaddress.com.br:80 \ install packagename Skip the username:password part if proxy doesn't require you to authenticate

    npm --proxy http://用户名:password@cacheaddress.com.br:80 \ install packagename如果代理不要求您进行身份验证,请跳过用户名:密码部分

    You may get NPM to work behind a proxy by setting BOTH HTTP_PROXY and HTTPS_PROXY environment variables, then issuing normally the command npm install express

    您可以通过设置BOTH HTTP_PROXY和HTTPS_PROXY环境变量让NPM在代理后面工作,然后正常发出命令npm install express

Good Luck

祝你好运