Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit 47f502d

Browse files
authored
Fix: react-native init command error (#2377)
1 parent fcb347f commit 47f502d

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

test/test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -308,13 +308,13 @@ class RNProjectManager extends ProjectManager {
308308
}
309309
mkdirp.sync(projectDirectory);
310310

311-
return TestUtil.getProcessOutput("react-native init " + appName, { cwd: projectDirectory, timeout: 30 * 60 * 1000 })
312-
.then((e) => { console.log(`"react-native init ${appName}" success. cwd=${projectDirectory}`); return e; })
311+
return TestUtil.getProcessOutput("npx react-native init " + appName, { cwd: projectDirectory, timeout: 30 * 60 * 1000 })
312+
.then((e) => { console.log(`"npx react-native init ${appName}" success. cwd=${projectDirectory}`); return e; })
313313
.then(this.copyTemplate.bind(this, templatePath, projectDirectory))
314314
.then<void>(TestUtil.getProcessOutput.bind(undefined, TestConfig.thisPluginInstallString, { cwd: path.join(projectDirectory, TestConfig.TestAppName) }))
315315
.then(() => { return null; })
316316
.catch((error) => {
317-
console.log(`"react-native init ${appName} failed". cwd=${projectDirectory}`, error);
317+
console.log(`"npx react-native init ${appName} failed". cwd=${projectDirectory}`, error);
318318
throw new Error(error);
319319
});
320320
}

0 commit comments

Comments
 (0)