Skip to content

Commit

Permalink
error out if using node less than 8.10, phetsims/chipper#737
Browse files Browse the repository at this point in the history
  • Loading branch information
zepumph committed Oct 24, 2019
1 parent 2b95c7a commit d8ddbcf
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/grunt/Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

// grunt tasks
const assert = require( 'assert' );
require( './checkNodeVersion' );
const checkoutDependencies = require( '../common/checkoutDependencies' );
const checkoutMaster = require( '../common/checkoutMaster' );
const checkoutMasterAll = require( './checkoutMasterAll' );
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' );
}

0 comments on commit d8ddbcf

Please sign in to comment.