diff --git a/docs/npm.html b/docs/npm.html index a22a475c..90003205 100644 --- a/docs/npm.html +++ b/docs/npm.html @@ -41,7 +41,7 @@
这个 npm 快速参考备忘单显示了它的常用命令使用清单。
# last modified: 01 Jan 2016
; Set a new registry for a scoped package
-@myscope:registry=https://mycustomregistry.example.org
+@myscope:registry=https://registry.npmmirror.com
注释使用 #
, ;
放置到一行的开头。.npmrc
文件由指定此注释语法的 npm/ini
解析
.npmignore
.npmignore
文件就像 .gitignore
一样工作。它不能覆盖 package.json#files
字段。
$ npm install -g <package-name> --registry=https://registry.npmmirror.com
+
# 临时使用
+$ npm install -g <package-name> --registry=https://registry.npmmirror.com
-将配置放置在 .npmrc
配置文件中。
registry=https://registry.npmmirror.com
+将配置放置在 .npmrc
全局配置文件中,或者在项目的根目录中。
+; registry=https://registry.npmjs.org/
+registry=https://registry.npmmirror.com
-或者配置到 package.json#publishConfig
字段上
+或者配置到 package.json#publishConfig
字段上
"publishConfig":{
"registry": "https://registry.npmmirror.com"
}
+替换 npm 仓库地址为 npmmirror(淘宝) 镜像地址
+npm config set registry https://registry.npmmirror.com
+
请参阅:npmmirror 中国镜像站
-