Nexus 3 的 Npm 的配置

配置Npm仓库地址

编辑 .npmrc 文件

registry = http://192.168.0.11:8082/repository/npm-public/

发布包

npm publish --registry http://192.168.0.11:8082/repository/npm-hosted/

或者在package.json添加配置

"publishConfig" : {
    "registry" : "http://192.168.0.11:8082/repository/npm-hosted/"
  }

发布的用户配置

转换加密的用户密码

echo -n 'admin:admin123' | openssl base64
#输出
YWRtaW46YWRtaW4xMjM=

或输入
在.npmrc上添加如下代码

init.author.name = Jane Doe
init.author.email = jane@example.com
init.author.url = http://blog.example.com
# an email is required to publish npm packages
email=jane@example.com
always-auth=true
_auth=YWRtaW46YWRtaW4xMjM=
Nexus 3 的 Npm 的配置
Share this