NPM Setup Agent

Source: Internet
Author: User

NPM gets the configuration in 6 ways, prioritized by high end.
    1. command-line arguments. --proxy http://server:portset the value of the proxy to http://server:port .

    2. Environment variables. The npm_config_ environment variables that are prefixed will be considered to be the configuration properties of NPM. If you set proxy, you can add such environment variables npm_config_proxy=http://server:port .

    3. The user configuration file. You can npm config get userconfig view the file path by looking at it. If it is a Mac system, the default path is $HOME/.npmrc .

    4. Global configuration file. You can npm config get globalconfig view the file path by looking at it. The default path for the Mac system is /usr/local/etc/npmrc .

    5. Built-in configuration files. Install the NPMRC file in the NPM directory.

    6. Default configuration. NPM itself has default configuration parameters, and if none of the above 5 is set, NPM will use the default configuration parameters.

Set up a proxy for NPM?
12 $ npm config setproxy http://server:port$ npm config sethttps-proxy http://server:port

This can be set if the agent requires authentication.

?
12 $ npm config setproxy http://username:[email protected]:port$ npm config sethttps-proxy http://username:[email protected]:port

If the agent does not support HTTPS, you need to modify the website address of the NPM store package.

?
1 $ npm config setregistry "http://registry.npmjs.org/"

NPM Setup Agent

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.