Skip to main content

Instalirajte kao Windows Service

Loosely based upon the instructions found here. I crafted the following and it provided me with a fully working verdaccio service installation:

  1. Kreirajte direktorijum za verdaccio
    • mkdir c:\verdaccio
    • cd c:\verdaccio
  2. Instalirajte verdaccio lokalno (događaju se problemi sa npm ako je instalacija globalna)
    • npm install verdaccio
  3. Kreirajte svoj config.yaml falj na ovoj lokaciji (c:\verdaccio\config.yaml)
  4. Windows Service Setup

Korišćenje NSSM

ALTERNATIVNI METOD: (WinSW paket je nedostajao kada je jedan od naših saradnika pokušao da ga preuzme)

  • Preuzmite NSSM i ekstrakujte

  • Dodajte putanju do nssm.exe u PATH

  • Otvorite administrative command

  • Run nssm install verdaccio At a minimum you must fill in the Application tab Path, Startup directory and Arguments fields. Assuming an install with node in the system path and a location of c:\verdaccio the below values will work:

    • Path: node

    • Startup directory: c:\verdaccio

    • Arguments: c:\verdaccio\node_modules\verdaccio\build\lib\cli.js -c c:\verdaccio\config.yaml

      You can adjust other service settings under other tabs as desired. When you are done, click Install service button

  • Start the service sc start verdaccio

Using WinSW

  • As of 2015-10-27, WinSW is no longer available at the below location. Please follow the Using NSSM instructions above.
  • Preuzmite WinSW
    • Postavite exe (primer, winsw-1.9-bin.exe) u ovaj folder (c:\verdaccio) i preimenujte u verdaccio-winsw.exe
  • Create a configuration file in c:\verdaccio, named verdaccio-winsw.xml with the following configuration xml verdaccio verdaccio verdaccio node c:\verdaccio\node_modules\verdaccio\src\lib\cli.js -c c:\verdaccio\config.yaml roll c:\verdaccio.
  • Install your service
    • cd c:\verdaccio
    • verdaccio-winsw.exe install
  • Pokrenite servis
    • verdaccio-winsw.exe start

Some of the above config is more verbose than I had expected, it appears as though 'workingdirectory' is ignored, but other than that, this works for me and allows my verdaccio instance to persist between restarts of the server, and also restart itself should there be any crashes of the verdaccio process.