Open UndefinedCpp opened 1 year ago
It will work on nodejs v16.x. The rules about importing JSON files changed in v18.x.
I have been running on v16.17.1 already, and so far the issue persists.
According to Google this was changed in 16.14
Okay, this error was solved using nodejs v16.13.2, but another error showed up :(
~/xxscreeps$ node -v
v16.13.2
~/xxscreeps$ npx xxscreeps import
node:internal/process/esm_loader:94
internalBinding('errors').triggerUncaughtException(
^
Error: Cannot find module './out/x64-linux-v16.13.2/pf.node'
Require stack:
- /home/lighthouse/xxscreeps/src/driver/path-finder/index.cjs
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (/home/lighthouse/xxscreeps/src/driver/path-finder/index.cjs:3:18)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:190:29) {
code: 'MODULE_NOT_FOUND',
requireStack: [ '/home/lighthouse/xxscreeps/src/driver/path-finder/index.cjs' ]
}
You need to delete node_modules and re-run npm install
Thank you it works! BTW, maybe we should document using node version <16.14.
We can leave this open actually in case people come looking for it. The real solution is to add a JSON type assertion which would make node >= 16.14 required. Totally crazy they changed this in a minor point release but I suppose this feature was under an --experimental
flag so that's their prerogative.
thank you for leaving this open, I was definitely trying to find an answer to this <3
I followed the instructions, installed and compiled, but unable to run
npx xxscreeps import
. I got the following error:How can I fix this? Thanks