Skip to content

Commit

Permalink
Throw an error if node version is below six
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Jan 15, 2017
1 parent c87aa9a commit b99b38d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
8 changes: 8 additions & 0 deletions bin/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
// Packages
const asyncToGen = require('async-to-gen/register')
const updateNotifier = require('update-notifier')
const {red} = require('chalk')
const nodeVersion = require('node-version')

// Ours
const pkg = require('../package')
Expand All @@ -12,6 +14,12 @@ asyncToGen({
excludes: null
})

// Throw an error if node version is too low
if (nodeVersion.major < 6) {
console.error(`${red('Error!')} Now requires at least version 6 of Node. Please upgrade!`)
process.exit(1)
}

// Let user know if there's an update
// This isn't important when deployed to Now
if (!process.env.NOW) {
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
"git-username": "^0.5.0",
"github": "^8.0.0",
"inquirer": "^2.0.0",
"node-version": "^1.0.0",
"open": "0.0.5",
"ora": "^0.4.1",
"pluralize": "^3.1.0",
Expand Down

0 comments on commit b99b38d

Please sign in to comment.