Skip to content
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

Don't run yarn after ejecting #2634

Merged
merged 1 commit into from
Jun 27, 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
17 changes: 15 additions & 2 deletions packages/react-scripts/scripts/eject.js
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,21 @@ inquirer
}

if (fs.existsSync(paths.yarnLockFile)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't the whole if statement be commented out and it just runs spawnSync('npm', ['install'], { stdio: 'inherit' }); every time?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If somebody has a lockfile they're likely using Yarn for development. Which means the versions they currently get might be more strict than allowed per semver. Running npm install on top risks giving them more fresh versions.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then looks like a perfectly reasonable temp fix to me.

console.log(cyan('Running yarn...'));
spawnSync('yarnpkg', [], { stdio: 'inherit' });
// TODO: this is disabled for three reasons.
//
// 1. It produces garbage warnings on Windows on some systems:
// https://github.com/facebookincubator/create-react-app/issues/2030
//
// 2. For the above reason, it breaks Windows CI:
// https://github.com/facebookincubator/create-react-app/issues/2624
//
// 3. It is wrong anyway: re-running yarn will respect the lockfile
// rather than package.json we just updated. Instead we should have
// updated the lockfile. So we might as well not do it while it's broken.
// https://github.com/facebookincubator/create-react-app/issues/2627
//
// console.log(cyan('Running yarn...'));
// spawnSync('yarnpkg', [], { stdio: 'inherit' });
} else {
console.log(cyan('Running npm install...'));
spawnSync('npm', ['install'], { stdio: 'inherit' });
Expand Down