npm安装

设置软件默认安装位置

1npm config set prefix "D:\Program Files\nodejs\node_global"

设置软件 缓存位置

1npm config set cache "D:\Program Files\nodejs\node_cache"

设置镜像源

1npm config set registry=http://registry.npm.taobao.org

npm 私有仓库

1、在命令行先查看

npm config get registry

2、修改本地或者tb镜像(搭建私服教程点这里 )

淘宝镜像npm config set registry http://registry.npm.taobao.org/
官方镜像npm config set registry https://registry.npmjs.org/
个人镜像npm config set registry http://10.168.2.76:38081/repository/npm-all/(这里地址自行改成自己配置的地址)

3、验证配置镜像

npm -loglevel info install grunt