Our project makes use of a native plugin we have created, which we store in the root of our project repo in a directory called plugin-src. Let’s say the plugin is called com.plugin.name.
We install the plugin using the following command;
ionic cordova plugin add plugin-src/com.plugin.name --save --nofetch
And all works swimmingly. This also updates package.json to include the following (abbreviate for readability);
"dependencies": {
"com.plugin.name": "file:plugins-src/com.plugin.name",
},
"cordova": {
"plugins": {
"com.plugin.name": {}
}
}
Everything works great, and we can add and remove the plugin all day long. However, if someone else pulls the repo and runs ‘npm install’ it fails, as it claims it can’t find the plugin.
What are we doing wrong? There must be a way to store the plugin local to the app surely?
To help shortcut some responses;
- We can’t store the plugin in a public Git repo, as its proprietary
- Likewise we can’t publish it to npm
- After npm install fails, we can manually add the plugin using the same ionic cordova plugin add command as above
- We’ve also tried installing with a path of ./ which adds the same to package.json, but fails in the same way
Can anyone help? We really want to have a repo where users can pull, run npm install and run ionic cordoba build and this is stopping us from being able to do so
For reference, here is our environment setup;
cli packages: (/usr/local/lib/node_modules)
@ionic/cli-utils : 1.10.2
ionic (Ionic CLI) : 3.10.3
global packages:
Cordova CLI : 7.0.1
local packages:
@ionic/app-scripts : 2.1.4
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.6.0
System:
Android SDK Tools : 25.2.3
ios-deploy : 1.9.2
ios-sim : 5.0.11
Node : v6.9.1
npm : 4.0.2
OS : macOS Sierra
Xcode : Xcode 9.0.1 Build version 9A1004
Any help would be really appreciated.