Skip to content

Commit 10eae80

Browse files
conorhastingsvjeux
authored andcommitted
add node engine to package.json and call checkNodeVersion function in cli (#88)
1 parent a35ac92 commit 10eae80

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

global-cli/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ function run(root, appName, version, verbose) {
112112
return;
113113
}
114114

115+
checkNodeVersion();
116+
115117
var scriptsPath = path.resolve(
116118
process.cwd(),
117119
'node_modules',
@@ -157,5 +159,6 @@ function checkNodeVersion() {
157159
process.version,
158160
packageJson.engines.node
159161
);
162+
process.exit(1);
160163
}
161164
}

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
"description": "Configuration and scripts for Create React App.",
55
"repository": "facebookincubator/create-react-app",
66
"license": "BSD-3-Clause",
7+
"engines": {
8+
"node": ">=4"
9+
},
710
"bugs": {
811
"url": "https://github.com/facebookincubator/create-react-app/issues"
912
},

0 commit comments

Comments
 (0)