-
查看当前npm的下载源
npm config get registry
-
全局配置npm使用淘宝镜像作为默认下载源
npm config set registry https://registry.npm.taobao.org --global
-
安装依赖包
npm install <package-name>
添加到devDependencies字段中:
npm install <package-name> --save-dev
查看当前npm的下载源
npm config get registry
全局配置npm使用淘宝镜像作为默认下载源
npm config set registry https://registry.npm.taobao.org --global
安装依赖包
npm install <package-name>
添加到devDependencies字段中:
npm install <package-name> --save-dev