Question
I followed instructions on this page: https://docs.requarks.io/install/windows but when I type command "node server" I receive following error message:
node : internal/modules/cjs/loader.js:983
At line:1 char:1
+ node server
+ ~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (internal/modules/cjs/loader.js:983:String) [], RemoteException
+ FullyQualifiedErrorId : NativeCommandError
throw err;
Error: Cannot find module 'C:\Users\xxxxx\server'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:980:15)
at Function.Module._load (internal/modules/cjs/loader.js:862:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:74:12)
at internal/main/run_main_module.js:18:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Host Info (please complete the following information):
OS: Windows 10
Wiki.js version: 2.3.77
Database engine: postgres 10.12
Node.js: 12.16.2
I receive same error in linux installation
root@linux-B:/media/DISK3/var/www/wiki.limbersoftware.com.br# node server
internal/modules/cjs/loader.js:621
throw e;
^
Error: No valid exports main found for '/media/DISK3/var/www/wiki.limbersoftware.com.br/node_modules/nanoid'
at resolveExportsTarget (internal/modules/cjs/loader.js:618:9)
at applyExports (internal/modules/cjs/loader.js:499:14)
at resolveExports (internal/modules/cjs/loader.js:548:12)
at Function.Module._findPath (internal/modules/cjs/loader.js:650:22)
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:948:27)
at Function.Module._load (internal/modules/cjs/loader.js:854:27)
at Module.require (internal/modules/cjs/loader.js:1023:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object.
at Module._compile (internal/modules/cjs/loader.js:1128:30) {
code: 'MODULE_NOT_FOUND'
}
Host Info (please complete the following information):
OS: Ubuntu 18.04.4 LTS
Wiki.js version: 2.3.77
Database engine: postgres 9.5.21
Node.js: v13.3.0
@AlexandreDC @michalcesek @fhiegel @asynder @FelixSFD
There is something missing in the nanoid upgrade guide here: https://github.com/ai/nanoid/releases/tag/3.0.0
I encountered the same problem, you folks had. The solution to fix the problem is to upgrade your nodejs to at least 13.12.0 (the details as to why are described in detail here: https://github.com/ai/nanoid/issues/206 ). I upgraded to 13.14.0 and solved the problem with it.
If you can confirm, that a nodejs upgrade also helps you in MacOSX and Ubuntu environments, then https://docs.requarks.io/install/requirements needs to be updated.
The docker image runs on Node.js 12.16.2 and it works just fine, so while upgrading might have fixed your issue, the node version is definitely not the cause.
@AlexandreDC are you sure #1787 and this issue are really the same? I just posted my fix here because you linked these two issues saying they are the same. I looked again into both initial error reports and they are different. I think my issue was the one described in #1787. According to @NGPixel comment, I would say these issues are not the same (different error messages).
These errors occur on Linux, MacOS, Windows.
Each platform shows errors in different ways, but the 3 errors have the same apparent cause: "loader.js" and "wiki 2.3.77"
@NGPixel that's interesting. Two people in the #1787 confirmed, that a nodejs upgrade fixed the problem for them as well. Which version of nanoid is used in the dockr image? If you dive a bit into https://github.com/ai/nanoid/issues/206, you will also find https://github.com/uuidjs/uuid/issues/428 and https://github.com/aws/aws-cdk/issues/7816. In https://github.com/aws/aws-cdk/issues/7816 they observe their specific import problem only from nodejs version 13.0.0 onwards, which would explain why with nodejs 12.16.2 the problem does not appear.
Added a note in the docs about Node.js 13.0 to 13.2 not being supported because of the ESM bug.
On another note, the 13.x release has reached its end-of-life and is no longer supported anyway.
Most helpful comment
@AlexandreDC @michalcesek @fhiegel @asynder @FelixSFD
There is something missing in the nanoid upgrade guide here: https://github.com/ai/nanoid/releases/tag/3.0.0
I encountered the same problem, you folks had. The solution to fix the problem is to upgrade your nodejs to at least 13.12.0 (the details as to why are described in detail here: https://github.com/ai/nanoid/issues/206 ). I upgraded to 13.14.0 and solved the problem with it.
If you can confirm, that a nodejs upgrade also helps you in MacOSX and Ubuntu environments, then https://docs.requarks.io/install/requirements needs to be updated.