管理员运行 powershell, 切换到 nexus-3.13.0-01/bin 目录shell
$
./nexus.exe /install
进行安装, 成功后会提示Installed service 'nexus
npm
$
./nexus.exe /run
运行服务, 第一次要耐心等待好久json
等待启动完毕后, 进入 http://127.0.0.1:8081
, 点击右上角 Sign In
登录, 默认帐号: admin 密码: admin123grunt
如下输入的Name都是根据本身需求修改url
Repositories
, 而后点击Create repository
按钮.npm(proxy)
, 输入 Name: npm-proxy, remote storage 填写 https://registry.npm.taobao.org 或 https://registry.npmjs.org. 用于将包情求代理到地址地址Create repository
按钮., 增长 npm(hossted) 输入 Name: npm-xueyou 用于存放本身的私有包Create repository
按钮.,增长npm(group) 输入 Name: npm-all, 下面Member repositories里选择以前添加的2个移动右边npm config set registry http://localhost:8081/repository/npm-all/
这里的url在仓库 npm-all 右边有获取urlnpm init -y
, npm --loglevel info install grunt
查看是否从本身的仓库地址拉取包npm login –registry=http://192.168.0.102:8081/repository/npm-all/
进行登录,须要填写帐号、密码以及邮箱npm login --registry=http://192.168.0.102:8081/repository/npm-all/
输入刚才新建用户的用户和密码和邮箱确保要发布的模块跟目录有 package.json 文件spa
npm adduser -registry http://192.168.0.102:8081/repository/npm-xueyou/
"publishConfig": { "registry": "http://192.168.0.102:8081/repository/npm-xueyou/" }
, 这样直接npm publish
就发布了nexus/bin
目录添加到环境变量nexus-start.bat
输入 nexus.exe /run
保存shell:startup
打开 C:\Users\tangdekun\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
目录, 将文件放进