mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Update check for Node version
This commit is contained in:
parent
abfebe0da5
commit
ba3016340a
|
|
@ -29,13 +29,13 @@ Installing
|
|||
|
||||
./pokemon-showdown
|
||||
|
||||
(Requires Node.js 6+)
|
||||
(Requires Node.js 8+)
|
||||
|
||||
|
||||
Detailed installation instructions
|
||||
------------------------------------------------------------------------
|
||||
|
||||
Pokémon Showdown requires you to have [Node.js][6] installed, 6.x or later.
|
||||
Pokémon Showdown requires you to have [Node.js][6] installed, 8.x or later (7.7 or later can work, but you might as well be on the latest stable).
|
||||
|
||||
Next, obtain a copy of Pokémon Showdown. If you're reading this outside of GitHub, you've probably already done this. If you're reading this in GitHub, there's a "Clone or download" button near the top right (it's green). I recommend the "Open in Desktop" method - you need to install GitHub Desktop which is more work than "Download ZIP", but it makes it much easier to update in the long run (it lets you use the `/updateserver` command).
|
||||
|
||||
|
|
|
|||
11
app.js
11
app.js
|
|
@ -44,11 +44,18 @@
|
|||
|
||||
const FS = require('./fs');
|
||||
|
||||
// Check for dependencies
|
||||
// Check for version and dependencies
|
||||
try {
|
||||
// I've gotten enough reports by people who don't use the launch
|
||||
// script that this is worth repeating here
|
||||
eval('{ let a = async () => {}; }');
|
||||
} catch (e) {
|
||||
throw new Error("We require Node.js version 8 or later; you're using " + process.version);
|
||||
}
|
||||
try {
|
||||
require.resolve('sockjs');
|
||||
} catch (e) {
|
||||
throw new Error('Dependencies are unmet; run node pokemon-showdown before launching Pokemon Showdown again.');
|
||||
throw new Error("Dependencies are unmet; run node pokemon-showdown before launching Pokemon Showdown again.");
|
||||
}
|
||||
|
||||
/*********************************************************
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
"ofe": "0.5.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6.0.0"
|
||||
"node": ">=7.7.0"
|
||||
},
|
||||
"main": "app.js",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -5,12 +5,12 @@ const child_process = require('child_process');
|
|||
const fs = require('fs');
|
||||
const path = require('path');
|
||||
|
||||
// Make sure we're Node 6+
|
||||
// Make sure we're Node 8+
|
||||
|
||||
try {
|
||||
eval('{ let [a] = [1]; }');
|
||||
eval('{ let a = async () => {}; }');
|
||||
} catch (e) {
|
||||
console.log("We require Node.js v6 or later; you're using " + process.version);
|
||||
console.log("We require Node.js version 8 or later; you're using " + process.version);
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user