Verdaccio还没有发布软件包

时间:2019-02-20 18:00:45

标签: npm verdaccio

从今天开始,verdaccio(v3.8.3)不再在本地注册表中显示软件包。

在浏览器上打开时,显示以下消息:尚未发布软件包

在配置(〜/ .local / share / verdaccio / storage)中指定的存储文件夹包含我所有的软件包。

但是数据库文件为空〜/ .local / share / verdaccio / storage / .sinopia-db.json。 确实从终端运行verdaccio我得到了这个:

 warn --- config file  - /home/bssadmin/.config/verdaccio/config.yaml
 error--- Package database file corrupted (invalid JSON), please check the error printed below.
File Path: /home/bssadmin/.local/share/verdaccio/storage/.sinopia-db.json SyntaxError: Unexpected end of JSON input
    at JSON.parse (<anonymous>)
    at LocalDatabase._parseDatabase (/home/bssadmin/.npm-packages/lib/node_modules/verdaccio/node_modules/@verdaccio/local-storage/lib/local-database.js:298:19)
    at LocalDatabase._fetchLocalPackages (/home/bssadmin/.npm-packages/lib/node_modules/verdaccio/node_modules/@verdaccio/local-storage/lib/local-database.js:272:23)
    at new LocalDatabase (/home/bssadmin/.npm-packages/lib/node_modules/verdaccio/node_modules/@verdaccio/local-storage/lib/local-database.js:49:22)
    at LocalStorage._loadStorage (/home/bssadmin/.npm-packages/lib/node_modules/verdaccio/build/lib/local-storage.js:809:14)
    at new LocalStorage (/home/bssadmin/.npm-packages/lib/node_modules/verdaccio/build/lib/local-storage.js:54:27)
    at Storage.init (/home/bssadmin/.npm-packages/lib/node_modules/verdaccio/build/lib/storage.js:64:25)
    at /home/bssadmin/.npm-packages/lib/node_modules/verdaccio/build/api/index.js:145:19
    at Generator.next (<anonymous>)
    at step (/home/bssadmin/.npm-packages/lib/node_modules/verdaccio/build/api/index.js:53:191)
 error--- Database is locked, please check error message printed during startup to prevent data loss.
(node:9242) ExperimentalWarning: The fs.promises API is experimental
 error--- Database is locked, please check error message printed during startup to prevent data loss.
 warn --- Plugin successfully loaded: htpasswd
 warn --- Plugin successfully loaded: audit
 warn --- http address - http://0.0.0.0:4873/ - verdaccio/3.8.3

发生了什么事?我该如何解决?

我应该用'verdaccio'标签标记此问题,但该标签不可用并且无法创建。

1 个答案:

答案 0 :(得分:0)

如果.sinopia-db.json.为空,则很可能已损坏。如果有任何私有软件包,则可能需要手动修复。

格式非常简单

{"list":["@test/test_1","@test/test_2","@test/test_3","test_4"],"secret":"secretKEYLongString"}

此文件必须是有效的JSON格式。

如果在另一个数据库中,数据库是空的,只需让列表数组为空,或者删除整个文件,然后重新启动服务器,Verdaccio将生成一个新的数据库。