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

add —use-npm flag to bypass yarn #3409

Merged
merged 2 commits into from
Nov 9, 2017
Merged

Conversation

tabrindle
Copy link
Contributor

Allow user to choose npm over yarn. This should close #3385.

@bondz
Copy link
Contributor

bondz commented Nov 5, 2017

Yes, this should work. We can add a test for this in the e2e tests though. Checking if a yarn.lock does not exist when this flag is specified should be sufficient, right?

@tabrindle
Copy link
Contributor Author

Yeah that's a great idea. Will add.

@react-scripts-dangerous
Copy link

Hello! I'm a bot that helps facilitate testing pull requests.

Your pull request (commit 547ad01) has been released on npm for testing purposes.

npm i [email protected]
# or
yarn add [email protected]
# or
create-react-app [email protected] folder/

Note that the package has not been reviewed or vetted by the maintainers. Only install it at your own risk!

Thanks for your contribution!

# ******************************************************************************

cd "$temp_app_path"
create_react_app --use-npm --scripts-version=0.4.0 test-use-npm-flag
Copy link
Contributor

@bondz bondz Nov 9, 2017

Choose a reason for hiding this comment

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

I don't think we need to install a specific version here.

This looks good to go. 👍

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 hurt 😄

@Timer
Copy link
Contributor

Timer commented Nov 9, 2017

Thanks!

@SimenB
Copy link
Contributor

SimenB commented Mar 19, 2018

This option should be documented, ref jestjs/jest#5119 (comment)

@corysimmons
Copy link

Should probably be documented, but tbh, I'm trash for not create-react-app --help and spotting it.

gaearon said something about not wanting to add flags a while back (albeit, in reference to adding a --bare option in favor of adding a more flexible --template option) so I just blindly assumed CRA didn't have flags. 😅

@AmitJoki
Copy link

What's the preferred way of using this flag on an existing project? I already have a CRA but I am wanting to opt out from yarn. How do I go about?

@bondz
Copy link
Contributor

bondz commented Apr 15, 2018

@AmitJoki Delete your yarn.lock file and run npm i and then continue to use npm commands thereafter.

Pavek pushed a commit to Pavek/create-react-app that referenced this pull request Jul 10, 2018
* add —use-npm flag to bypass yarn

* add e2e test for —use-npm flag
@lock lock bot locked and limited conversation to collaborators Jan 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Yarn is used automatically with no obvious way to use npm instead
8 participants