Permalink
Browse files

Fix ENOENT when react-native init with --verbose on Windows

Summary:
As PR #5171 was reverted in 521bd03 for breaking reason, ENOENT again in issues #5169 , this commit fix it ref to nodejs/node-v0.x-archive#2318 (comment) , and this is the smallest change in file to fix such Windows platform specific bug tdzl2003 mkonicek snowdream sunnylqm
Closes #10086

Differential Revision: D3919761

Pulled By: bestander

fbshipit-source-id: b878bbade8142a87bd6703d485e501eb28761af5
  • Loading branch information...
1 parent 9f792c2 commit 2289909374f1aabf4232b4578aaee176b989edaa @flyskywhy flyskywhy committed with Facebook Github Bot 7 Sep 25, 2016
Showing with 1 addition and 1 deletion.
  1. +1 −1 react-native-cli/index.js
@@ -230,7 +230,7 @@ function run(root, projectName, rnPackage) {
}
function runVerbose(root, projectName, rnPackage) {
- var proc = spawn('npm', ['install', '--verbose', '--save', '--save-exact', getInstallPackage(rnPackage)], {stdio: 'inherit'});
+ var proc = spawn(/^win/.test(process.platform) ? 'npm.cmd' : 'npm', ['install', '--verbose', '--save', '--save-exact', getInstallPackage(rnPackage)], {stdio: 'inherit'});
proc.on('close', function (code) {
if (code !== 0) {
console.error('`npm install --save --save-exact react-native` failed');

0 comments on commit 2289909

Please sign in to comment.