Using npusing Npm behindm Behind a Corporate Proxy

Source: Internet
Author: User

On a recent assignment, I needed to install NPM behind a corporate proxy. I had already set the environment variables Http_proxy and Https_proxy. Other command line utilities, like Ruby Gems, recognized these environment variables. NPM did not.

After some googling, I found the following-to-configure the proxy for NPM.
NPM Config set proxy http://proxy.company.com:8080npm config set https-proxy http://proxy.company.com:8080
If you need to specify credentials, they can is passed in the URL using the following syntax.
Http://user_name:[email protected]:8080
Further exploration of the NPM Config documentation showed that the NPM Config set command sets the proxy configuration in Your. npmrc file. You can also set the proxy configuration as a command line argument or environment variable.

Configuration parameters can specified using-when executing NPM. So the proxy could also is specified as follows.
NPM--https-proxy=http://proxy.company.com:8080-g Install Karma
To pass configurattion parameters to NPM as environment variables, they must is prefixed with npm_config_. The proxy configuration could is set with environment variables as follows.
Export Npm_config_proxy http://proxy.company.com:8080export npm_config_https_proxy http://proxy.company.com:8080

Using npusing Npm behindm Behind a Corporate Proxy

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.