NPM obtains configuration and sets proxy

Source: Internet
Author: User

There are six methods for obtaining and configuring NPM, with the highest priority.
    1. Command line parameters.-- Proxy http: // server: PortSet the proxy valueHttp: // server: Port.

    2. Environment variable. ToNpm_config _Environment variables with a prefix are considered as NPM configuration attributes. If you set proxy, you can add such environment variables.Npm_config_proxy = http: // server: Port.

    3. User configuration file. You can useNPM config get userconfigView the file path. The default path is$ Home/. npmrc.

    4. Global configuration file. You can useNPM config get globalconfigView the file path. The default path for Mac is/Usr/local/etc/npmrc.

    5. Built-in configuration file. Install the npmrc file in the NPM directory.

    6. Default Configuration. NPM has default configuration parameters. If none of the above five items are set, NPM uses the default configuration parameters.

Set proxy for NPM?
12 $ NPM configSet Proxy http:// Server: Port$ NPM configSet Https-proxy http:// Server: Port

If the proxy needs authentication, you can set it like this.

?
12 $ NPM configSet Proxy http:// Username: [Email protected]: Port$ NPM configSet Https-proxy http:// Username: [Email protected]: Port

NPM obtains configuration and sets 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.