Skip to content

add —use-npm flag to bypass yarn#3409

Merged
Timer merged 2 commits into
react:masterfrom
tabrindle:use-npm-flag
Nov 9, 2017
Merged

add —use-npm flag to bypass yarn#3409
Timer merged 2 commits into
react:masterfrom
tabrindle:use-npm-flag

Conversation

@tabrindle

Copy link
Copy Markdown
Contributor

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

@bondz

bondz commented Nov 5, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
Contributor Author

Yeah that's a great idea. Will add.

@react-scripts-dangerous

Copy link
Copy Markdown

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 react-scripts-dangerous@1.0.17-547ad01.0
# or
yarn add react-scripts-dangerous@1.0.17-547ad01.0
# or
create-react-app --scripts-version=react-scripts-dangerous@1.0.17-547ad01.0 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!

Comment thread tasks/e2e-installs.sh
# Test --use-npm flag
# ******************************************************************************

cd "$temp_app_path"

@bondz bondz Nov 9, 2017

Copy link
Copy Markdown
Contributor

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
Copy Markdown
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

Timer commented Nov 9, 2017

Copy link
Copy Markdown
Contributor

Thanks!

@SimenB

SimenB commented Mar 19, 2018

Copy link
Copy Markdown
Contributor

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

@corysimmons

Copy link
Copy Markdown

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
Copy Markdown

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

bondz commented Apr 15, 2018

Copy link
Copy Markdown
Contributor

@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