Skip to content

Conversation

denisbabineau
Copy link

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 cordova-plugin-app-version@0.1.8 to Cordova project:
TypeError: Uh oh!
Object [object Object] has no method 'parse'
at handlers.js-module.install (//.meteor/local/cordova-build/platforms/android/cordova/lib/pluginHandlers.js:142:66)

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 :-)

…ng installation with older version of nodejs
@DennisSmolek
Copy link

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...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants