Add a flag to force create-react-app to use a specific package manager
Created by: leojiang
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:
-
When using
yarn
, if the registryregistry.yarnpkg.com
cannot be reached withdns.lookup
, thenyarn
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 -
Anyway for situation no.1, uninstall
yarn
can solve the problem andnpm
is used instead. But I need to usenpm
andyarn
both and I can't uninstallyarn
. 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!