diff --git a/js/grunt/Gruntfile.js b/js/grunt/Gruntfile.js index 3b26ed7e6..1e19e5faf 100644 --- a/js/grunt/Gruntfile.js +++ b/js/grunt/Gruntfile.js @@ -12,6 +12,7 @@ const assert = require( 'assert' ); const buildRunnable = require( './buildRunnable' ); const buildStandalone = require( './buildStandalone' ); const buildWrapper = require( './phet-io/buildWrapper' ); +require( './checkNodeVersion' ); const child_process = require( 'child_process' ); const ChipperConstants = require( '../common/ChipperConstants' ); const chipperGlobals = require( './chipperGlobals' ); diff --git a/js/grunt/checkNodeVersion.js b/js/grunt/checkNodeVersion.js new file mode 100644 index 000000000..71415d57e --- /dev/null +++ b/js/grunt/checkNodeVersion.js @@ -0,0 +1,17 @@ +// Copyright 2019, University of Colorado Boulder + +/** + * Error out if Node version is out of date. Uses process.version + * + * @author Michael Kauzmann (PhET Interactive Simulations) + */ + +'use strict'; + +// constants +const NODE_VERSION_STRING_PARTS = process.version.replace( 'v', '' ).split( '.' ); +const NODE_MAJOR_VERSION = parseInt( NODE_VERSION_STRING_PARTS[ 0 ], 10 ); +const NODE_MINOR_VERSION = parseInt( NODE_VERSION_STRING_PARTS[ 1 ], 10 ); +if ( NODE_MAJOR_VERSION < 8 || ( NODE_MAJOR_VERSION === 8 && NODE_MINOR_VERSION < 10 ) ) { + throw new Error( 'Node 8.10 or greater is needed to run PhET build tools' ); +} diff --git a/js/grunt/lint.js b/js/grunt/lint.js index efdf66be0..409fc6044 100644 --- a/js/grunt/lint.js +++ b/js/grunt/lint.js @@ -17,8 +17,8 @@ const path = require( 'path' ); const child_process = require( 'child_process' ); // constants -// don't lint these repos -const NO_LINT_REPOS = [ +const NO_LINT_REPOS = [ // don't lint these repos + 'babel', 'eliot', 'phet-android-app',