查看node 版本
node -v
查看node安装路径
where node
清除nodejs安装目录下node_cache的缓存(针对部安装vue-cli时提示 npm ERR! code EEXIST npm ERR! path)
npm cache clean –force(清除node缓存)
以上命令清除无效了请清除以下目录文件
C:\Program Files\nodejs\node_cache
设置缓存以及全局
npm config set prefix “D:\Program Files\nodejs\node_global”
npm config set cache “D:\Program Files\nodejs\node_cache”
https://blog.csdn.net/weixin_43937400/article/details/106481384
https://blog.csdn.net/haisong/article/details/104585361/
——–nrm
在命令行执行命令,npm install -g nrm,全局安装nrm
C:\WINDOWS\system32>nrm ls
npm -------- https://registry.npmjs.org/
yarn ------- https://registry.yarnpkg.com/
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/
其中,带*的是当前使用的源,上面的输出表明当前源是官方源
切换node源
如果要切换到taobao源,执行命令nrm use taobao
增加node源
增加定制的源,特别适用于添加企业内部的私有源,执行命令 nrm add ,其中reigstry为源名,url为源的路径
nrm add registry http://registry.npm.frp.trmap.cn/
删除node源
nrm del registry http://registry.npm.frp.trmap.cn/
可以通过 nrm test 测试相应源的响应时间
nrm test npm
nvm 切换nodejs版本管理工具
https://www.cnblogs.com/gaozejie/p/10689742.html
ng –version