1

I am trying to install Verdaccio as windows service, following official guide. Before using nssm I manually tried service's command in powershell:

node .\node_modules\verdaccio\build\lib\cli.js -c .\config.yaml

However I get error:

cannot open config file C:\redacted\config.yaml: false

Where C:\redacted\config.yaml is correctly resolved absolute path of .\config.yaml.

Error doesn't happen on development Windows 10 machine, only on server with Windows server 2016. .\config.yaml exists and has permissions set to everything for Everyone. Running same command in administrator powershell works.

Matija Sirk
  • 596
  • 2
  • 15

1 Answers1

1

I've also encountered this problem before. It's actually caused by errors in the config.yaml file. However, after verdaccio v5.x, there is no longer a prompt, instead it only displays "cannot open config file /verdaccio/conf/config.yaml: false". But when I use verdaccio v4, it can prompt normally, and I don't understand why the error prompt was removed in the new version.

You can verify using Docker:

docker pull verdaccio/verdaccio:4

docker run -it --name verdaccio -p 4873:4873 -v /root/verdaccio/conf:/verdaccio/conf -v /root/verdaccio/storage:/verdaccio/storage -v /root/verdaccio/plugins:/verdaccio/plugins verdaccio/verdaccio:4

Then you can receive a prompt similar to this:

fatal--- cannot open config file /verdaccio/conf/config.yaml: YAMLException: can not read a block mapping entry; a multiline key may not be an implicit key at line 170, column 5: web: zh-CN ^

You can try it out, and best regards to you.

  • I don't think this was the issue - exactly same config with same version of verdaccio worked on dev machine, but not on server. In the end clean reinstall of node, npm & verdaccio somehow fixed it. Still, thanks thats good advice for most cases. – Matija Sirk Jun 26 '23 at 05:06
  • Yes, this problem can be quite a headache at times, so using Docker can mitigate most issues caused by different environments. – xiaosen chen Jun 27 '23 at 06:06