Skip to content

Instantly share code, notes, and snippets.

@AaronNGray
Last active October 6, 2019 00:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AaronNGray/68f28d9ed0e087b6935bf983f16e9248 to your computer and use it in GitHub Desktop.
Save AaronNGray/68f28d9ed0e087b6935bf983f16e9248 to your computer and use it in GitHub Desktop.

How to install verdaccio as a Windows Service from the command line.

Download NSSM and install it in a directory on the path.

Install npm_lazy :-

npm install -g verdaccio

Create a configuration file :-

cd "%userprofile%\AppData\Roaming\npm\node_modules\verdaccio"
copy conf\default.yaml config.yaml

To create a Windows Service for npm_lazy :-

nssm install verdaccio "%ProgramFiles%\nodejs\node.exe"
nssm set verdaccio AppDirectory "%userprofile%\AppData\Roaming\verdaccio"
nssm set verdaccio AppParameters "%userprofile%\AppData\Roaming\npm\node_modules\verdaccio\build\lib\cli.js -c %userprofile%\AppData\Roaming\verdaccio\config.yaml"

To point NPM at npm_lazy :-

npm config set registry http://localhost:4873/

To start the Service :-

nssm start verdaccio

To restart the service :-

nssm restart verdaccio

To stop the service :-

nssm stop verdaccio

To remove the service :-

nssm remove verdaccio confirm

Adding npm_lazy npm cache as an uplink :-

config.yaml

uplinks:
  npm_lazy:
    url: http://localhost:8080
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment