mwaylabs / generator-m-ionic

Advanced workflows and setup for building rock-solid Ionic apps
MIT License
672 stars 135 forks source link

cordova: Error: spawn node_modules/cordova/bin/cordova [param] ENOENT #500

Closed marcoramires closed 7 years ago

marcoramires commented 7 years ago

Is there any permission setting I should add?

It keeps throwing an error each time I try to run a cordova command such as $gulp --cordova "platform ls".

[13:52:01] Using gulpfile ~/m-ionic/gulpfile.js
[13:52:01] Starting 'default'...
[13:52:01] Starting 'cordova'...
[13:52:01] Finished 'default' after 22 ms
events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: spawn node_modules/cordova/bin/cordova platform ls ENOENT
    at exports._errnoException (util.js:856:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:178:32)
    at onErrorNT (internal/child_process.js:344:16)
    at nextTickCallbackWith2Args (node.js:475:9)
    at process._tickCallback (node.js:389:17)

Node: v5.6.0 Cordova: v6.5.0 Gulp: v3.9.1

marcoramires commented 7 years ago

I found a temporary solution in case somebody is having the same issue.

Rolled back "gulp-shell" to version 0.5.2 as the 0.6.1 is causing the issue when passing any parameter to shell commands.

package.json

"gulp-shell": "^0.5.1",

gruppjo commented 7 years ago

Hi @marcoramires. Another way to fix this might be to upgrade to at least node 6.x. Someone had a similar issue: https://github.com/mwaylabs/generator-m-ionic/issues/499

Can you confirm upgrading to a newer node version fixes this?

marcoramires commented 7 years ago

Hi @gruppjo. Thanks for the reply.

Yeah it works fine once upgraded to node v6.0.0. Interesting enough npm will install the version 0.5.2 instead of the 0.6.1 ("gulp-shell": "^0.5.1").