Skip to content

Commit 5c7217d

Browse files
insinvjeux
authored andcommitted
Fix running npm install from create-react-app command and init script on Windows (#6)
1 parent 1b1c82f commit 5c7217d

File tree

4 files changed

+4
-2
lines changed

4 files changed

+4
-2
lines changed

global-cli/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737

3838
var fs = require('fs');
3939
var path = require('path');
40-
var spawn = require('child_process').spawn;
40+
var spawn = require('cross-spawn');
4141
var chalk = require('chalk');
4242
var semver = require('semver');
4343
var argv = require('minimist')(process.argv.slice(2));

global-cli/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
},
1010
"dependencies": {
1111
"chalk": "^1.1.1",
12+
"cross-spawn": "^4.0.0",
1213
"minimist": "^1.2.0",
1314
"semver": "^5.0.3"
1415
}

package.json

+1
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
"babel-preset-es2016": "^6.11.3",
3333
"babel-preset-react": "^6.11.1",
3434
"css-loader": "^0.23.1",
35+
"cross-spawn": "^4.0.0",
3536
"eslint": "^2.13.1",
3637
"eslint-config-airbnb": "^9.0.1",
3738
"eslint-loader": "^1.4.1",

scripts/init.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
var fs = require('fs');
1111
var path = require('path');
12-
var spawn = require('child_process').spawn;
12+
var spawn = require('cross-spawn');
1313

1414
module.exports = function(hostPath, appName, verbose) {
1515
var selfPath = path.join(hostPath, 'node_modules', 'create-react-app-scripts');

0 commit comments

Comments
 (0)