Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Enforcing the engines property of package.json

Document your target environment with:

"engines": {
  "npm": ">=3.3.12 <4",
  "node": ">=5.5.0 <6"

Then install this:

"devDependencies": {
  "check-node-version": "1.1.0"

And barf when running on an incompatible platform:

"scripts": {
  "build": "check-node-version --package && ...",
  "watch": "check-node-version --package && ..."
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.