1. Install the Node on the server

Official website: nodejs.org/zh-cn/

2. Install verdaccio

NPM install - global verdaccioCopy the code

3. After the installation, enter the verdaccio command to run it

Verdaccio doesn't need superuser privileges. Don't run it under root.
 warn --- config file  - /root/.config/verdaccio/config.yaml
 warn --- Plugin successfully loaded: htpasswd
 warn --- Plugin successfully loaded: audit
 warn --- http address - http://localhost:4873/ - verdaccio/3.10.2
Copy the code

4. Modify the configuration file (config/verdaccio/config. Yaml)

/ root/config/verdaccio/config. The yaml find config. The last line yaml and listen: IP: host (for example: listen: 192.168.0.1:4873)

5. Use PM2 to start verdaccio and ensure that the process is always open

npm install -g pm2 --unsafe-perm
pm2 start verdaccio
Copy the code

6. Change the local source IP address

···NPM·· NPM config set registry http://x.x.x.x:4873 ···CNPM··· CNPM config set registry http://x.x.x.x:4873 ··YARN··· ·  yarn config set registry http://x.x.x.x:4873Copy the code

7. Release the local project package

npm login

npm publish