npm_lazy icon indicating copy to clipboard operation
npm_lazy copied to clipboard

Installing npm_lazy as a Windows Service

Open AaronNGray opened this issue 5 years ago • 2 comments

I have been using Verdaccio https://verdaccio.org/ installed as a Windows Service. I am wondering if the same can be done for npm_lazy. I cannot find any instruction for doing this, so will experiment and report back, and mabe do a documentation pull request if I get something working properly.

AaronNGray avatar Oct 04 '19 14:10 AaronNGray

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

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

Install npm_lazy and create a configuration file :-

npm install -g npm_lazy
npm_lazy --init > "%userprofile%/npm_lazy.config.js"

To create a Windows Service for npm_lazy :-

nssm install npm_lazy "%ProgramFiles%\nodejs\node.exe"
nssm set npm_lazy AppDirectory "%userprofile%\.npm_lazy"
nssm set npm_lazy AppParameters "%userprofile%\AppData\Roaming\npm\node_modules\npm_lazy\bin\npm_lazy --config %userprofile%\npm_lazy.config.js"

To point NPM at npm_lazy :-

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

To start the Service :-

nssm start npm_lazy

To restart the service :-

nssm restart npm_lazy

To stop the service :-

nssm stop npm_lazy

To remove the service :-

nssm remove npm_lazy confirm

AaronNGray avatar Oct 05 '19 02:10 AaronNGray

Can someone verify this all works correctly then it may be added to the npm_lazy documentation.

AaronNGray avatar Oct 05 '19 02:10 AaronNGray