Node.js 范围和存储库
示例
# Set the repository for the scope "myscope" npm config set @myscope:registry http://registry.corporation.com # Login at a repository and associate it with the scope "myscope" npm adduser --registry=http://registry.corporation.com --scope=@myscope # Install a package "mylib" 从范围 "myscope" npm install @myscope/mylib
如果您自己的软件包的名称以开头,@myscope并且范围“myscope”与其他存储库相关联,npmpublish则将您的软件包上传到该存储库。
您还可以将以下设置保存在.npmrc文件中:
@myscope:registry=http://registry.corporation.com //registry.corporation.com/:_authToken=xxxxxxxx-xxxx-xxxx-xxxxxxxxxxxxxxx
当在CI服务器上自动化构建时,这很有用