Skip to content

Fix Yarn usage instructions #342

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 4, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 9 additions & 13 deletions react-native-scripts/src/scripts/init.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ https://github.com/npm/npm/issues/16991
let args = [];

if (useYarn) {
command = 'yarn';
command = 'yarnpkg';
} else {
command = 'npm';
args = ['install', '--save'];
Expand All @@ -123,14 +123,10 @@ https://github.com/npm/npm/issues/16991
}
}

log(`Installing dependencies using ${command}...`);
const npmOrYarn = useYarn ? 'yarn' : 'npm';
log(`Installing dependencies using ${npmOrYarn}...`);
log(); // why is this here

if (command === 'yarn') {
// Use the more unique `yarnpkg` alias to avoid naming conflicts with other tools.
command = 'yarnpkg';
}

const proc = spawn(command, args, { stdio: 'inherit' });
proc.on('close', code => {
if (code !== 0) {
Expand All @@ -153,30 +149,30 @@ https://github.com/npm/npm/issues/16991
Success! Created ${appName} at ${appPath}
Inside that directory, you can run several commands:

${chalk.cyan(command + ' start')}
${chalk.cyan(npmOrYarn + ' start')}
Starts the development server so you can open your app in the Expo
app on your phone.

${chalk.cyan(command + ' run ios')}
${chalk.cyan(npmOrYarn + ' run ios')}
(Mac only, requires Xcode)
Starts the development server and loads your app in an iOS simulator.

${chalk.cyan(command + ' run android')}
${chalk.cyan(npmOrYarn + ' run android')}
(Requires Android build tools)
Starts the development server and loads your app on a connected Android
device or emulator.

${chalk.cyan(command + ' test')}
${chalk.cyan(npmOrYarn + ' test')}
Starts the test runner.

${chalk.cyan(command + ' run eject')}
${chalk.cyan(npmOrYarn + ' run eject')}
Removes this tool and copies build dependencies, configuration files
and scripts into the app directory. If you do this, you can’t go back!

We suggest that you begin by typing:

${chalk.cyan('cd ' + cdpath)}
${chalk.cyan(command + ' start')}`
${chalk.cyan(npmOrYarn + ' start')}`
);

if (readmeExists) {
Expand Down