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

884 views Asked by At

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.

1

There are 1 answers

2
xiaosen chen On

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.