-
Notifications
You must be signed in to change notification settings - Fork 27
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
Detect which package manager to invoke #46
Comments
Please take a look at apache/cordova-cli#292. Especially @dpogue's and my comment towards the end of the discussion. In short: I do not think that this is feasible, the way cordova currently works. If you are interested in more technical details, I can provide them. Thanks for taking the time to create this issue and providing some helpful links too. |
Well, I just tried I would question that tighter integration with Perhaps as an interim measure, cordova fetch at least checks which package manager is used, and fails early when it isnt |
I think only supporting NPM because of tight coupling with that package manager is an indication that some plugins are not using package managers in a way the're supposed to. However, since I just started to try things with Cordova and because I don't know how things work you should take my comment with a grain of sailt. Preferences aside, in the JavaScript community nobody expects not being able to swap NPM with Yarn, so I think that should be documented in the basic introductions like the "Get started": https://cordova.apache.org/ |
Although 'spypkg' doesn't detect which package manager to use, its capable of parsing npm expressions to be mapped into yarn expressions. When installed and configured, in essence it intercepts execution, maps the expression and executes the modified expression. |
Ionic provides an elegant implementation of this in the form of |
https://github.com/pnpm/pnpm is almost a drop-in replacement for npm, and I am successfully using it with cordova-fetch by creating a symlink from
npm
topnpm
.The flags used by cordova-fetch are also compatible with
yarn
, afaics, but I havent tested that. npm is also planning a new package manager on the horizon, https://github.com/npm/tink , which looks likely to support the same args.@zkochan, creator of pnpm, has created https://github.com/zkochan/which-pm to do the detection, so it should be fairly easy to invoke the correct package manager, using the same flags.
The text was updated successfully, but these errors were encountered: