Node.js Related Configuration
Configuring npm Global Installation Path and Cache Path
Create two new folders node_cache
and node_global
in the nvm
root directory. If you haven't installed npm before, you can use nvm install --lts
to install the latest stable version and use it with nvm use <version-number>
, or specify a version with nvm install <version-number>
.
Configuring npm cache
and prefix
Paths
bash
npm config set cache "D:\nvm\node_cache"
npm config set prefix "D:\nvm\node_prefix"
Checking npm Cache and Global Installation Paths
bash
npm config get cache
npm config get prefix
Checking npm Registry
bash
npm config get registry
Configuring npm Registry
bash
npm config set registry https://registry.npmmirror.com
Available Registry Mirrors
- Taobao NPM Mirror: https://registry.npmmirror.com
- cnpm Mirror: http://r.cnpmjs.org
- Official npm Registry: https://registry.npmjs.org
- Tencent Cloud NPM Mirror: https://mirrors.cloud.tencent.com/npm/ (For more available mirrors, visit Available Open Source Mirrors)
- Huawei Cloud NPM Mirror: https://mirrors.huaweicloud.com/repository/npm/
- Beijing Foreign Studies University Mirror: https://mirrors.bfsu.edu.cn/nodejs-release/npm/