- 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
- 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
- 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