Shenchuanhuan/hello-world

#npm 相关

Opened this issue · 0 comments

npm 镜像设置命令

// 以淘宝源为例
npm config set registry https://registry.npm.taobao.org --global
npm config set disturl https://npm.taobao.org/dist

删除已设置的镜像源

npm config delete registry
npm config delete disturl

npm config edit
//然后找到之前设置时的两行命令行,删除即可

切换npm 镜像源

推荐:nrm

cnpm 的问题

cnpm有个问题:用它下载安装的模块都是以软链形式存在的,本来模块文件就多,再加个软链又多一倍文件,导致有些编辑器和IDE检索目录时非常慢。

npmrc 是 npm runtime config 的意思,可以通过这个文件在命令行环境中为 npm 提供环境变量。

更新npm到最新版本

npm install npm@latest -g