Npm 私有仓库安装内部依赖
方式一(推荐,可以连外网优先使用这个可以避免占用较大服务器存储空间)
Npm 私有仓库下载依赖地址:http://192.168.140.17:8081/nexus/repository/npm-private
更新以下文件:
C:\Users\xxx\.npmrc
1. *# SASS*
2. sass_binary_site=https://registry.npmmirror.com/-/binary/node-sass
3.
4. *# **@power**:registry=http://192.168.140.17:8081/nexus/repository/npm-group/*
5. @power:registry=http://192.168.140.17:8081/nexus/repository/npm-private/
6.
7. registry=https://registry.npmmirror.com/
方式二(不推荐,纯内网使用,占用服务器存储空间较大可能高达40G)
Npm 私有仓库下载依赖地址:http://192.168.140.17:8081/nexus/repository/npm-group/
安装:
1. 1.npm install -g nnrm
2. npm install -g rimraf
3. npm install -g pnpm
4. nnrm add power http://192.168.140.17:8081/nexus/repository/npm-group/
5. nnrm use power
Npm 私有仓库发布内部依赖
登录准备发布新版本 npm adduser 之后输入用户名密码
发布新版本 npm publish --registry=http://192.168.140.17:8081/nexus/repository/npm-private/
查看现有库 http://192.168.140.17:8081/nexus/