I am writing a Cordova plugin, it has a node dependency for one of the hook scripts. Ideally, when my plugin is installed:
$ cordova plugin add my-cordova-plugin
I would like it to run npm install if package.json has the dependencies listed.
Does Cordova support this function in some way? Did I miss something?
My current solution is another hook that triggers after_plugin_install :
module.exports = function (context) { var shell = context.requireCordovaModule('shelljs'); shell.cd(context.opts.plugin.dir); shell.exec('npm install'); };
cloakedninjas
source share