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 a flag to force create-react-app to use a specific package manager #2809

Closed
leojiang opened this issue Jul 18, 2017 · 4 comments
Closed
Milestone

Comments

@leojiang
Copy link

Background:

create-react-app uses yarn as the default installation tool if it is found in the environment.
source code: line 195 in createReactApp.js

There're two special situation:

  1. When using yarn, if the registry registry.yarnpkg.com cannot be reached with dns.lookup, then yarn will switch to offline mode and try to use local cache. But I don't have any cached modules at all. Then it goes to a dead end!!
    source code: line 616 in createReactApp.js

  2. Anyway for situation no.1, uninstall yarn can solve the problem and npm is used instead. But I need to use npm and yarn both and I can't uninstall yarn. It goes to a dead end again!!!

So, Is it possible to add a parameter for user to specify which installation tool(yarn/npm) to be used dynamically?

Thanks!

@gaearon gaearon changed the title Is it possible to add a parameter for user to specify installation tool(yarn/npm) dynamically? Add a flag to force create-react-app to use npm Jan 8, 2018
@gaearon gaearon added this to the 1.x milestone Jan 8, 2018
@gaearon
Copy link
Contributor

gaearon commented Jan 8, 2018

I'd be happy to take a PR that lets you pass something like create-react-app --pm=npm or create-react-app --pm=pnpm and it will use that manager.

@gaearon gaearon changed the title Add a flag to force create-react-app to use npm Add a flag to force create-react-app to use a specific package manager Jan 8, 2018
@gaearon
Copy link
Contributor

gaearon commented Jan 14, 2018

Actually, just realized we already support --use-npm flag. I think this is probably enough for now. It was added in #3409 and hasn't been released yet but we can close this.

@gaearon gaearon closed this as completed Jan 14, 2018
@vjpr
Copy link

vjpr commented Feb 19, 2018

I still think we should allow --pm=pnpm.

@Timer
Copy link
Contributor

Timer commented Feb 26, 2018

Feel free to submit a PR @vjpr, I'd be happy to review it.

@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

No branches or pull requests

4 participants