We need to use the npm command to install verdaccio, so we have to have a node environment.node
step1: install the node environmentnpm
Open cmd and input 'node -v'json
step2:Installation start verdacciowindows
Open cmd and input 'npm install -g verdaccio'post
input 'verdaccio'spa
After the startup is successful, open http://localhost:4873/ and see the interface is successful.rest
Find the configuration file of verdaccio, You can modify the configuration by referring to https://verdaccio.org/docs/en...code
verdaccio runs by default in the port 4873,we can change the listen address and port.server
After change the configurations,then restart the verdaccio, open http://10.137.118.26:3001/#/ and can see the interface like belowblog
The private repository has been set up.
We need to use our client to configure our registry to use our private repository.The client is the developer's development computer.You need to install the node environment.
you need to register or login your account. If we don't have an account yet, we can create it by entering the command npm adduser --registry http://10.137.118.26:3001 and then entering the username in turn. If you already have an account, you can log in by entering the command npm login --registry http://10.137.118.26:3001 and then entering the username and password. Then enter the code directory we need to upload, execute the command to publish.
Just got a project name called 'example', there is nothing in it, npm init creates a new package.json.The package.json code is as follows:
register account like below:
when we register a account,it will auto login.
Then we can use the npm publish command to publish the package.
And,we can see the package published success.
Just open a project called 'test', Use the command npm install '@sfc/example' to download the npm package we just posted to private.
After the download is complete, we can see the example file in the node_modules folder of the project.