Use Verdaccio to Publish npm package to a local repository
So you can use verdaccio to build a local repository.
npm install -g verdaccio, you may need add
sudo if there are no permission.
verdaccio in the bash.
It will show the url of the verdaccio server, and the default config. These two infomation is required at later.
warn --- config file - ~/.config/verdaccio/config.yaml warn --- Plugin successfully loaded: verdaccio-htpasswd warn --- Plugin successfully loaded: verdaccio-audit warn --- http address - http://localhost:4873/ - verdaccio/4.0.4
As we see, the default server url is
http://localhost:4873/, the default config path is
Steps to Enable Anonymous Pusblish
Edit the config.yaml
packages: '**': access: $anonymous publish: $anonymous proxy: npmjs
Restart the verdaccio server.
Resolve the problem of anonymous access still need token
According to this issue, we still need a fake token.
Create a .npmrc file under the project you are going to publish.
As you know, the
verdaccio server url.
Publish Package to Local
npm --registry http://localhost:4873 publish
--registry option set the target server to publish - here is the local verdaccio server.
Download the Package from the Local Repository
npm install --registry http://localhost:4873