cordova-plugin-app-version
cordova-plugin-app-version copied to clipboard
add missing attribute for js-module tag
was causing obscure bug during installation with older version of nodejs, as is the case when using meteor (uses its own version of node currently at v0.10.41 where the 'path' package doesn't have the 'parse' method (see error below):
=> Errors executing Cordova commands:
While adding plugin [email protected] to Cordova project:
TypeError: Uh oh!
Object [object Object] has no method 'parse'
at handlers.js-module.install (/
and the culprit code (last line falls back to parsing the src attribute for a name if name is not defined):
'js-module': {
install: function (obj, plugin, project, options) {
// Copy the plugin's files into the www directory.
var moduleSource = path.resolve(plugin.dir, obj.src);
var moduleName = plugin.id + '.' + (obj.name || path.parse(obj.src).name);
Defining the name attribute just avoids this mess :-)
This looks good to me, I'll need to test and there are a few open PR's at the moment that I may merge up together for an update, this will likely go on that branch...