npm config set registry https://registry.npm.taobao.org
npm config get registry
https://registry.npm.taobao.org
,说明镜像配置成功。npm config set registry https://registry.npmjs.org
npm install nrm -g
nrm ls
node:internal/validators:119
throw new ERR_INVALID_ARG_TYPE(name, 'string', value);
^
[TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
at new NodeError (node:internal/errors:363:5)
at validateString (node:internal/validators:119:11)
at Object.join (node:path:429:7)
at Object. (C:\Users\Admin\AppData\Roaming\npm\node_modules\nrm\cli.js:17:20)
at Module._compile (node:internal/modules/cjs/loader:1109:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1138:10)
at Module.load (node:internal/modules/cjs/loader:989:32)
at Function.Module._load (node:internal/modules/cjs/loader:829:14)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:76:12)
at node:internal/main/run_main_module:17:47
] {
code: 'ERR_INVALID_ARG_TYPE'
}
npm view nrm versions
npm uninstall -g nrm
npm install -g nrm@1.1.0
nrm -V
或者nrm --version
* npm ---- https://registry.npmjs.org/
cnpm --- http://r.cnpmjs.org/
taobao - https://registry.npm.taobao.org/
nj ----- https://registry.nodejitsu.com/
npmMirror https://skimdb.npmjs.com/registry/
edunpm - http://registry.enpmjs.org/
npm install -g cnpm --registry=https://registry.npm.taobao.org
cnpm install xxx
其中在node v16.3.0环境下使用淘宝镜像安装一些package时出现报错,后续找到方法后更新,建议先忍一忍,使用原始镜像。