Skip to content

Commit 6e14cf3

Browse files
committed
Use npx to execute global npm packages
1 parent 7a4e177 commit 6e14cf3

File tree

6 files changed

+4
-21
lines changed

6 files changed

+4
-21
lines changed

src/commands/cra.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,6 @@ module.exports = {
4242
// prettier-ignore
4343
info(showInitializationMessage({ name, shouldUseNpm }));
4444

45-
try {
46-
await extensions.cra.checkCli();
47-
} catch (e) {
48-
error('Please install create-react-app first');
49-
return;
50-
}
5145
await extensions.cra.init({ name, shouldUseNpm });
5246

5347
info('Adding linter');

src/commands/expo.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ module.exports = {
4545
// prettier-ignore
4646
info(showInitializationMessage({ name, shouldUseNpm, template }));
4747

48-
try {
49-
await extensions.expo.checkCli();
50-
} catch (e) {
51-
error('Please install expo-cli first');
52-
return;
53-
}
5448
// prettier-ignore
5549
await extensions.expo.init({ template, name, shouldUseNpm });
5650

src/commands/reactNative.js

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,6 @@ module.exports = {
4545
// prettier-ignore
4646
info(showInitializationMessage({ name, shouldUseNpm, version }));
4747

48-
try {
49-
await extensions.rn.checkCli();
50-
} catch (e) {
51-
error('Please install react-native-cli first');
52-
return;
53-
}
5448
await extensions.rn.init({ name, shouldUseNpm, version });
5549

5650
info('Adding linter');

src/extensions/craCli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = (toolbox) => {
1414
// prettier-ignore
1515
const cmd = buildCommand([
1616
cdIntoPath && `cd ${cdIntoPath} &&`,
17+
'npx',
1718
'create-react-app',
1819
name,
1920
shouldUseNpm && '--use-npm',

src/extensions/expoCli.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ module.exports = (toolbox) => {
1414
// prettier-ignore
1515
const cmd = buildCommand([
1616
cdIntoPath && `cd ${cdIntoPath} &&`,
17+
'npx',
1718
'expo',
1819
'init',
1920
'--name',

src/extensions/reactNativeCli.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ module.exports = (toolbox) => {
88
return commandExists('react-native');
99
}
1010

11-
function init({
12-
cdIntoPath, name, shouldUseNpm, version,
13-
}) {
11+
function init({ cdIntoPath, name, shouldUseNpm, version }) {
1412
const cmd = buildCommand([
1513
cdIntoPath && `cd ${cdIntoPath} &&`,
14+
'npx',
1615
'react-native',
1716
'init',
1817
name,

0 commit comments

Comments
 (0)