【问题标题】:Wiki.js Installation in Windows Localhost在 Windows 本地主机中安装 Wiki.js
【发布时间】:2021-02-05 03:27:29
【问题描述】:

我正在尝试在 Windows 10 localhost 上安装到 Wiki.js。执行 node server

时出现以下错误
(node:11360) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of null
at Object.init (C:\wiki\server\core\db.js:35:37)
at Object.init (C:\wiki\server\core\kernel.js:13:35)
at Object. (C:\wiki\server\index.js:35:13)
at Module._compile (internal/modules/cjs/loader.js:1158:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)
at Module.load (internal/modules/cjs/loader.js:1002:32)
at Function.Module._load (internal/modules/cjs/loader.js:901:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47
(node:11360) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:11360) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我有以下内容: 节点版本 v12.16.1 npm 版本 6.13.4 MySQL Ver 15.1 Distrib 10.4.11-MariaDB,适用于 Win64 (AMD64),源修订版 7c2c420b70b19cc02b5281127205e876f3919dad

感谢任何帮助

【问题讨论】:

标签: javascript node.js wiki.js


【解决方案1】:

你需要编写config.yml文件,(db: type: mysql)。您可能将其保留为“postgres”。

【讨论】:

    【解决方案2】:

    您好我解决了问题,我只是在我的数据库中输入了密码并在配置文件中报告了它,但是我在安装的最后一步出现了另一个问题(我使用 mySQL 服务器和 Apache 服务器)我有这个错误.

     PS C:\wiki> node server
    Loading configuration from C:\wiki\config.yml... OK
    2022-01-21T08:55:01.300Z [MASTER] info: =======================================
    2022-01-21T08:55:01.304Z [MASTER] info: = Wiki.js 2.5.268 =====================
    2022-01-21T08:55:01.309Z [MASTER] info: =======================================
    2022-01-21T08:55:01.310Z [MASTER] info: Initializing...
    2022-01-21T08:55:24.541Z [MASTER] info: Using database driver pg for postgres [ OK ]
    2022-01-21T08:55:24.551Z [MASTER] info: Connecting to database...
    node:assert:171
      throw err;
      ^
    
    AssertionError [ERR_ASSERTION]: unknown message code: 59
        at Parser.handlePacket (C:\wiki\node_modules\pg-protocol\dist\parser.js:140:34)
        at Parser.parse (C:\wiki\node_modules\pg-protocol\dist\parser.js:39:38)
        at Socket.<anonymous> (C:\wiki\node_modules\pg-protocol\dist\index.js:11:42)
        at Socket.emit (node:events:390:28)
        at addChunk (node:internal/streams/readable:315:12)
        at readableAddChunk (node:internal/streams/readable:289:9)
        at Socket.Readable.push (node:internal/streams/readable:228:10)
        at TCP.onStreamRead (node:internal/stream_base_commons:199:23) {
      generatedMessage: false,
      code: 'ERR_ASSERTION',
      actual: undefined,
      expected: undefined,
      operator: 'fail'
    }
    

    【讨论】:

    • 如果您有新问题,请点击 按钮提出问题。如果有助于提供上下文,请包含指向此问题的链接。 - From Review
    【解决方案3】:

    访问您的数据库是密码问题。

    在 Object.init (/home/kamla/wiki/server/core/db.js:35:37)

    如果您不想为默认 root 用户分配密码,我建议您使用密码创建新用户。 遵循 MySQL 指南:

    [https://www.digitalocean.com/community/tutorials/how-to-create-a-new-user-and-grant-permissions-in-mysql-fr][1]

    您可以对另一个 DBMS 执行相同的过程。 然后在 config.yml 中重做你的配置。

    当您在没有密码的情况下离开pass: 行时,您会收到以下错误:

    2021-03-16T10:43:26.617Z [MASTER] 错误:数据库初始化错误:用户 'root'@'localhost' 的访问被拒绝(使用密码:YES)

    【讨论】:

      猜你喜欢
      • 2023-04-01
      • 2013-09-30
      • 2018-10-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多