How can I get Cordova to use js yarn instead of npm to add plugins

Question updated

I am currently adding plugins to my cordova project using the cordova plugin add x command. I believe this uses npm in the background.

Does anyone know how I can switch npm for js yarn (inside the cordova, I want the cordova to use yarn instead of npm), since that would make such a huge difference in terms of caching (other than updating the cli cord).

Conclusion

December 2016

It seems that installing yarn means that yarn takes with npm as the default package manager, and thus things are accelerated by default and that no manipulation of Cordova is required.

September 2017

It seems that I was mistaken, apparently, Cordoba is hard-coded to use npm, https://issues.apache.org/jira/browse/CB-12242 . I will reopen this problem to ask Apache to do this.

+5
source share
3 answers

There seems to be no short answer - this is currently not possible, but I'm going to request an update from Apache: https://issues.apache.org/jira/browse/CB-12242

0
source

First set the yarn with this command.

 npm install -g yarn 

After that, you can use the yarn to set the cord, like this

  yarn global add cordova 
-3
source

thats How you can use the yarn package manager instead of Npm.

  npm install -g yarn yarn global add cordova 
-5
source

Source: https://habr.com/ru/post/1261204/


All Articles