- 此客製化版本,專門用於 Andrash-AutomationKit。
- 主要的差異是增加了「default_data」目錄,及「apply_default_user_data.bat」檔案。
- 「default_data」目錄:此目錄中包含了 verdaccio-windows 啟動時所需要的設定檔預設範本,如: config.yaml。
- 「apply_default_user_data.bat」檔案:執行此檔案可自動套用預設設定檔。會將 default_data 中的所有檔案複製到 user_data 目錄中
- 「user_data」目錄:此目錄中包含了 verdaccio-windows 啟動時所需要的設定檔們。其中的 storage 目錄裝載了所有已被上傳到伺服器的套件。若此目錄不存在,可執行 apply_default_user_data.bat 來套用 default_data 中的檔案。
- verdaccio-windows 必須先經過安裝程序才可被啟動使用,安裝時必須傳入參數指定所要使用的設定檔,此時就可傳入「user_data/config.yaml」作為設定檔。詳情請參考下面的 Installation 章節。
Verdaccio is very useful server that provides "A lightweight private npm proxy registry".
This package allows the installation and running of Verdaccio as a Windows Service.
- Install nodejs for windows.
- Download the release zip file and uzip to an install location.
- Change to the install location and run
npm install --production
. - Create a verdaccio configuration file to configure your verdaccio installation.
- Use the service install command with the -c flag to point to your config file.
node service.js install -c path\to\verdaccio-config.yaml
- Use the service start command to start your service.
Windows firewall may need to be configured to allow the node process act as a server.
Use can the --name -n option to customize the windows service name. See the install command for more service configuration options.
Use the runner script with the -c
option:
node runner.js -c path\to\verdaccio-config.yaml
This is useful to see the verdaccio's output for any errors.
When the service is created the install location will have a daemon
sub directory. By default the service logs verdaccio standard output and error to this folder. This location can be changed using the service.js install's --logs
option.
NOTE By default verdaccio logs all http requests, so the log files can get very large. To address this use the verdaccio configuration file to setup logging.
As Verdaccio uses apache htpasswd files for its authetication by default. The htpasswd script is included to ease setup. To use change directory to the install location then run npm run htpasswd
Use this to create a htpasswd file and manage the accounts in it. NOTE Ensure Verdaccio is configured to point to the htpasswd file you created.
Use the service.js command to manage a verdaccio service.
Use node service.js help
for more information.
Use node service.js <command> --help
for information on a specific command.
Manages Verdaccio Services
Usage:
service.js <command> [options]
Commands:
service.js install installs the service
service.js uninstall uninstalls the service
service.js start starts the service
service.js stop stops the service
service.js restart restarts the service
Options:
--help Show help [boolean]
--version Show version number [boolean]
--name, -n The name to use for the service [string] [default: "Verdaccio"]
service.js install
installs the service
Options:
--help Show help [boolean]
--version Show version number [boolean]
--name, -n The name to use for the service
[string] [default: "Verdaccio"]
--config, -c The path to the verdaccio configuration file [string]
--description, -d The description of the service
[string] [default: "Verdaccio Package Registry"]
--logs The directory to log the service output
--account The account to run the service as
--account.name account name
--account.password The password for the account.
--account.domain The domain of the account
service.js uninstall
uninstalls the service
Options:
--help Show help [boolean]
--version Show version number [boolean]
--name, -n The name to use for the service [string] [default: "Verdaccio"]
service.js start
starts the service
Options:
--help Show help [boolean]
--version Show version number [boolean]
--name, -n The name to use for the service [string] [default: "Verdaccio"]
service.js stop
stops the service
Options:
--help Show help [boolean]
--version Show version number [boolean]
--name, -n The name to use for the service [string] [default: "Verdaccio"]
service.js restart
restarts the service
Options:
--help Show help [boolean]
--version Show version number [boolean]
--name, -n The name to use for the service [string] [default: "Verdaccio"]