Skip to content

Commit

Permalink
error out if using node less than 8.10, #737
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 24, 2019
1 parent 243ddb9 commit 7bc62e7
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
1 change: 1 addition & 0 deletions js/grunt/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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' );
Expand Down
17 changes: 17 additions & 0 deletions js/grunt/checkNodeVersion.js
Original file line number Diff line number Diff line change
@@ -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' );
}
4 changes: 2 additions & 2 deletions js/grunt/lint.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down

0 comments on commit 7bc62e7

Please sign in to comment.