Config
下载node-v20.17.0-x64.msi
nodejs中新建 node_global、node_cache
配置路径
npm config set prefix ".\nodejs\node_global"
npm config set cache ".\nodejs\node_cache"
验证
npm config get prefix
npm config get cache
node -v
npm -v
设置变量
用户变量
D:\Program Files\nodejs\node_global
系统变量
D:\Program Files\nodejs\node_global\node_modules
安装镜像源
默认镜像源
npm config set registry https://registry.npmjs.org
淘宝镜像
npm config set registry https://registry.npmmirror.com
华为镜像
npm confg set registry https://mirrors.huaweicloud.com/repository/npm/
查看镜像
npm config get registry
SSL
当 strict-ssl 设置为 false 时,npm 会在下载依赖或进行网络请求时忽略 SSL 证书的验证:
npm set strict-ssl=false
清除npm缓存
npm cache clean --force
Node-red
npm install -g --unsafe-perm node-red
npm install -g --unsafe-perm node-red --registry=https://registry.npmmirror.com
http://localhost:1880
Addition
express
npm install express -g
标签:Node,npm,set,node,nodejs,js,registry,config From: https://www.cnblogs.com/Chiaki17/p/18445613