smogon / pokemon-showdown-client

The client for Pokémon Showdown
http://pokemonshowdown.com
GNU Affero General Public License v3.0
560 stars 786 forks source link

Error when building the desktop client on Debian #1978

Closed aknight2015 closed 2 years ago

aknight2015 commented 2 years ago

I made sure to install nodejs and npm using the native Debian repositories. It starts fine, but eventually crashes out with the following error:

`/home/aknight2015/Games/pokemon-showdown-client/build-tools/compiler.js:51 if (fileResults.some(result => result?.map)) { ^

SyntaxError: Unexpected token '.' at wrapSafe (internal/modules/cjs/loader.js:915:16) at Module._compile (internal/modules/cjs/loader.js:963:27) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object. (/home/aknight2015/Games/pokemon-showdown-client/build-tools/update:15:18) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) child_process.js:674 throw err; ^

Error: Command failed: node ./build-tools/update at checkExecSyncError (child_process.js:635:11) at execSync (child_process.js:671:15) at Object. (/home/aknight2015/Games/pokemon-showdown-client/build:67:1) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) at internal/main/run_main_module.js:17:47 { status: 1, signal: null, output: [ null, null, null ], pid: 25910, stdout: null, stderr: null }`

So, what do I need to do to fix this? I wish there was an error log I could attach.

mia-pi-git commented 2 years ago

You need to upgrade to node 14. That supports optional chaining.

aknight2015 commented 2 years ago

That did it.