简体   繁体   中英

Ionic/Cordova: How to install plugin into existing project?

How do I install an additional Cordova plugin into an existing Ionic/Cordova project? I need the Cordova Camera Plugin. If I try:

cordova plugin add https://github.com/apache/cordova-plugin-camera.git

I get error:

Error: Command failed: fatal: could not create work tree dir .... No such file or directory.

You are doing the right thing but you have camera.git at the end. That is the problem. This is correct way of doing it! It worked for me.

$ cordova plugin add org.apache.cordova.camera

The best way to install cordova plugin in ionic by tapping these commands line :

$ionic cordova plugin add cordova-plugin-camera
$npm install --save @ionic-native/camera

Add the plugin in your module app here

And follow the instruction on the official documentation https://ionicframework.com/docs/native/camera/

Good luck :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM