Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add engines property to package.json - Closes #1487 #1489

Merged
merged 3 commits into from
Nov 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .nvmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
6.14.4
12 changes: 12 additions & 0 deletions config/checkNodeVersion.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const semver = require('semver');
const { engines } = require('../package');

const version = engines.node;
const currentVersion = process.version;

if (!semver.satisfies(currentVersion, version)) {
console.error(`\n\tCurrent node version ${currentVersion} \n\tRequired node version ${version}...\n`); // eslint-disable-line no-console
throw new Error('Invalid current node version');
} else {
console.info('\n\tThe current node version satisfy the required version...\n\n'); // eslint-disable-line no-console
}
11 changes: 8 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
"bugs": "https://github.com/LiskHQ/lisk-hub/issues",
"main": "main.js",
"scripts": {
"postinstall": "node ./config/checkNodeVersion.js",
"build": "npm run clean-build && npm run copy-files && npm run build-prod && npm run build-electron",
"build:testnet": "npm run build:testnet:pre",
"build:testnet:pre": "cpx \"./app/build/**\" ./app/build-testnet && npm run build:testnet:post",
Expand Down Expand Up @@ -92,9 +93,10 @@
"react-waypoint": "7.1.0",
"redux": "3.7.2",
"redux-thunk": "=2.2.0",
"semver": "5.6.0",
"snyk": "^1.108.0",
"socket.io-client": "=2.0.3",
"webpack-merge": "=4.1.0",
"snyk": "^1.108.0"
"webpack-merge": "=4.1.0"
},
"devDependencies": {
"@storybook/addon-actions": "3.2.12",
Expand Down Expand Up @@ -242,5 +244,8 @@
"postcss-cssnext"
]
},
"snyk": true
"snyk": true,
"engines": {
"node": ">=v6.10.0 <=v6.14.4"
}
}