Verdaccio lot: github.com/verdaccio/v…
Let’s start with the renderings
The installation
1. Run the command to pull the Docker image of Verdaccio
docker pull verdaccio/verdaccio
2. Run the following command to create a config folder in the user root directory to save the configuration
mkdir -p ~/config
3, Execute command, clone project
git clone https://github.com/verdaccio/docker-examples
4. Run the following command to add the configuration
cd docker-examples
mv docker-local-storage-volume ~/config/verdaccio
5. Run the following command to add permission
chown -R 100:101 ~/config/verdaccio
6. Edit the file and set permissions
Edit ~ / config/verdaccio/conf/config. The yaml, configuration push_user, admin users have access to package, the admin user has permissions, contracting out the other user without permission.
packages:
'**':
access: push_user admin
publish: admin
proxy: npmjs
Copy the code
7. Run the following command to start the image
docker run --name verdaccio -itd -p 4873:4873 -v ~/config/verdaccio:/verdaccio ~/config/verdaccio/storage:/verdaccio/storage verdaccio/verdaccio
Project installation
1. Run the. NPMRC command to create an NPM source
vim .npmrc
2. Add the following content to.npMRc
Registry = http://0.0.0.0:4873/
3. Run the command to log in to the NPM private warehouse
NPM login - registry at http://0.0.0.0:4873
4. Run the following command to install project dependencies
npm i
other
1. NPM relies on slow installation to set taobao source
npm config set registry https://registry.npm.taobao.org