Use Nexus Repository Manager to build npm PW

Download and install

  1. In the official website to download Nexus Repository Manager OSS 3.x , unzip to any location.
  2. Administrators run powershell, switch to the nexus-3.13.0-01 / bin directory

    $ ./nexus.exe /install After installation, you will be prompted success Installed service 'nexus

    $ ./nexus.exe /run Run the service, the first minor to wait for a long time

  3. After waiting for boot up, enter  http://127.0.0.1:8081, click on the upper right corner of  Sign In the landing, the default account: admin password: admin123

Add npm warehouse

The following input Name are modified according to their needs

  • Click on the left menu Repositories, then click Create repositorythe button.
  • Select  npm(proxy), enter Name: npm-proxy, remote storage fill  https://registry.npm.taobao.org  or  https://registry.npmjs.org for packet case the address request to the address proxy.
  • Click again Create repositorybutton to add npm (hossted) Enter Name:. Npm-xueyou used to store their own private package
  • Click again Create repositorybutton to add npm (group) Enter Name:. Npm-all, before the addition of the following Member repositories in the right choice of two move

Configuration and verification npm warehouse

  • $ npm config set registry http://localhost:8081/repository/npm-all/ Url url here have acquired the right warehouse in npm-all
  • Not enter a directory, initialize Package Penalty for,  npm init -ynpm --loglevel info install grunt to see if an address from its own warehouses pull package
  • Set permissions, Realms menu, add npm Bearer Token Realm to the right
  • Add users, then  npm login –registry=http://192.168.0.102:8081/repository/npm-all/ landing, need to fill out the account, password and email
  • Log  npm login --registry=http://192.168.0.102:8081/repository/npm-all/ enter just the new user's password and user and mailbox

Post your own package

To ensure the release of the module with the file directory has package.json

  1. Add user npm adduser -registry http://192.168.0.102:8081/repository/npm-xueyou/
  2. Release package, npm publish -registry  http://192.168.0.102:8081/repository/npm-xueyou/
  3. Modify package.json added  "publishConfig": { "registry": "http://192.168.0.102:8081/repository/npm-xueyou/" }, so directly npm publishon the release of

Nexus enable Boot

  1. nexus/bin Directory to the environment variable
  2. New  nexus-start.bat input  nexus.exe /run save
  3. win + r input  shell:startup to open  C:\Users\tangdekun\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup the directory, the file into

Guess you like

Origin www.cnblogs.com/xiaojf/p/11280887.html