3 related configurations for node. js

Source: Internet
Author: User

    1. Prefix
      • This setting affects the global node_modules path (the current global node_modules path can be viewed via NPM root-g);
      • The modification method is to execute "NPM config set prefix global path";
      • Note that the global path here does not need to be specific to .../lib/node_modules, set as Lib's parent directory on it;
      • For example, NPM config set prefix/users/xman/node/, then the global node_modules path is/users/xman/node/lib/node_modules;
      • If the NPM config modification is not valid, modify the configuration file directly. NPMRC
    2. Node_path
      • This is added to the environment variable, otherwise node cannot find the module in the global node_modules
      • If it's a Mac system, add a line to the. Bash_profile (new, user directory).
      • Export Node_path=/users/xman/node/lib/node_modules
      • Linux is. BASHRC
    3. PATH
      • A node's executable path is added to the PATH environment variable before it can be used directly from the command line;
      • Add a line to the. Bash_profile configuration file
      • Path= $PATH:/users/xman/node/bin

3 related configurations for node. js

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.