smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.77k stars 2.79k forks source link

Identifier 'Dex' has already been declared #4729

Closed race421 closed 6 years ago

race421 commented 6 years ago

botuser@toysever:~/Pokemon-Showdown$ nodejs pokemon-showdown 8000 /home/botuser/Pokemon-Showdown/pokemon-showdown:123 const Dex = require('./sim/dex'); ^

SyntaxError: Identifier 'Dex' has already been declared at Object. (/home/botuser/Pokemon-Showdown/pokemon-showdown:1:11) at Module._compile (module.js:410:26) at Object.Module._extensions..js (module.js:417:10) at Module.load (module.js:344:32) at Function.Module._load (module.js:301:12) at Function.Module.runMain (module.js:442:10) at startup (node.js:136:18) at node.js:966:3

race421 commented 6 years ago

update I am getting that same error on a lot of variable names well so far streams and stdin as well

Zarel commented 6 years ago

That's incredibly weird. What version of Node.js are you using?

Zarel commented 6 years ago

I can't think of a Node version that passes the version test and–

OHHH IT'S AN INCREDIBLY OLD VERSION OF NODE THAT'S WHY

Zarel commented 6 years ago

Anyway, your problem is that you installed Node from repositories. Repositories only offer incredibly outdated versions of Node.

Do this:

npm i -g n
n latest
./pokemon-showdown 8000