nexus的npm配置

nexus是可以搭建maven,npm,docker,pypi私有仓库的工具,本文记录npm的安装配置

配置nexus的npm

  • 添加认证:按图示进入realms设置页,将npm Bearer Token Realm加入active即可。

    npm添加认证

  • npm-taobao-proxy

    1
    2
    3
    Remote storage:https://registry.npm.taobao.org/
    Use the Nexus truststore:勾选
    Blob store:npm
  • npm-3rd-hosted

    1
    2
    Blob store:npm
    Deployment policy: Allow redeploy
  • npm-group(注意Members顺序)

    1
    2
    3
    4
    Blob store:npm
    Members:
    - npm-3rd-hosted
    - npm-taobao-proxy

配置本地npm

  • 用户级别配置

  • ~/.npmrc(若没有需要新建)

  • .npmrc配置如下:

    1
    registry = http://ip:port/nexus/repository/npm-group/

参考链接

分享到