Wiki.js Installation in Windows Localhost

3.9k Views Asked by At

I am trying to install to Wiki.js on windows 10 localhost. I am getting the following error when doing 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.

I have following : node version v12.16.1 npm version 6.13.4 MySQL Ver 15.1 Distrib 10.4.11-MariaDB, for Win64 (AMD64), source revision 7c2c420b70b19cc02b5281127205e876f3919dad

Any help is appreciated

3

There are 3 best solutions below

0
On

It's a password problem to access your database.

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

I recommend that you create a new user with a password if you don't want to assign a password to your default root user. follow this guide for MySQL:

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

You can follow the same procedure for another DBMS. Then redo your configuation in config.yml.

When you leave the pass: line without password, you get this error:

2021-03-16T10:43:26.617Z [MASTER] error: Database Initialization Error: Access denied for user 'root'@'localhost' (using password: YES)

1
On

Hello I resolve the problem, I just put a password in my database and report it in the config file, but I have another problem, (I use mySQL server and Apache server) in the final step of installation I have this error.

 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'
}
0
On

You need to write config.yml file, (db: type: mysql). You probably left it as "postgres".