Adding gulpStartupTasks to ionic.project causes ionic serve to error on 1.2.5
Adding gulpStartupTasks parameter in ionic.project causes ionic serve to fail with the following error.
Rogers-MacBook-Pro:tester roger$ ionic serve
Gulp startup tasks: [ 'sass', 'watch' ]
Running dev server: http://172.17.10.222:8100
Running live reload server: http://172.17.10.222:35729
Watching : [ 'www/**/*', '!www/lib/**/*' ]
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit
events.js:72
throw er; // Unhandled 'error' event
^
Error: spawn ENOENT
at errnoException (child_process.js:980:11)
at Process.ChildProcess._handle.onexit (child_process.js:771:34)
My ionic.project file is as follows
{
"name": "Tester",
"app_id": "com.bxthree.tester",
"gulpStartupTasks": ["sass", "watch"]
}
This doesn't seem to be related to the tasks specified within gulpStartupTasks. All tasks specified within this parameter can be run directly via Gulp without issue. Specifying an empty array for gulpStartupTasks also causes the error.
{
"name": "Tester",
"app_id": "com.bxthree.tester",
"gulpStartupTasks": []
}
Removing gulpStartupTasks from ionic.project allows ionic serve to one again function normally.
Thanks
Would you be able to run npm install first and then see if you still get the error? Thanks
No problem, the issue still persists after running npm install however. I've also upgraded to latest version of node just in case but no difference.
Rogers-MacBook-Pro-:tester roger$ node -v
v0.10.31
What OS and version are you on?
OS X 10.9.4
@boardman, 172. IPs can be a bit buggy, especially on older routers. Would you be able to try this on a 10. or 192.168. network?
To reset your default IP selection you'll need to run ionic address
Thanks for the continued suggestions. I've tried it on a 192.168. network but there is no change.
I see the problem even in the simplest scenario, creating a blank project with ionic start test, then editing ionic.project to include gulpStartupTasks with an empty list will throw the error.
{
"name": "test",
"app_id": "",
"gulpStartupTasks": []
}
I'm getting the impression that this must be down to my local configuration given no one else is seeing the issue.
Not sure if this was solved yet or not, however I ran into the same problem recently and the fix was to ensure gulp was installed globally npm install gulp -g so that the spawn method actually had something to spawn.
I was also having the same issue and "npm install gulp -g" solved it. ionic serve apparently prefers to have it locally as it says: "Local gulp not found. Try running: npm install gulp"
I fixed this by installing Imagemagick and gulp.
The following finally fixed this for me also
npm install -g imagemagick
This is still a problem. Would be nice for this to work out of the box, or at least for the documentation to mention the workaround.
Cross referencing with the forum: http://forum.ionicframework.com/t/ionic-serve-spawn-enoent/9079/10
@depsypher - I've updated the CLI to run a few checks:
If the user has gulpStartupTasks specified, but does not have gulp installed globally, they shall be shown a message to do so.
I hope this resolves the issue you have had. This should ship in 1.3.1.