Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

离线安装依赖 内网环境管理项目依赖 verdaccio

安装 npm install -g verdaccio

设置代理

# 直接设置
npm set registry http://localhost:4873

# 或使用 nrm(需先安装:npm install -g nrm)
nrm add verdaccio http://localhost:4873
nrm use verdaccio

前端使用

1. 注册用户

进入项目目录 package.json package.lock.json 所在目录

npm adduser --registry http://localhost:4873
# 按提示输入用户名、密码、邮箱

# 已注册,登录
npm login --registry http://localhost:4873

2. 发布

npm publish

3. 强制安装所有依赖,同时会缓存到4873

npm cache clean --force && npm install --force --registry http://localhost:4873