Ionic serve spawn ENOENT

Hi,

Today after running the beta feature ‘ionic setup sass’, ‘ionic serve’ is broken. Not sure it comes from Sass as I’ve been doing several things at once like including React.

Being pretty new to this environment, I have no idea where this comes from. I tried to reinstall and update everything but no luck and the error isn’t quite self-explanatory (seems like some file is missing). Any hint where to look for more verbose or how to fix this?

λ ionic serve
Running dev server: http://192.168.0.25:8100
Running live reload server: http://192.168.0.25:35729

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:998:11)
    at Process.ChildProcess._handle.onexit (child_process.js:789:34)

First off, love your avatar!

Yeah this error mean that you have another live reload server going.

i got same error too,
first i run ionic setup sass
second i run ionic serve
then the error is out.
i think it’s not ( this error mean that you have another live reload server going)
it’s sass build error.but i have no idea.
who help me?

Secondly, love your framework! :stuck_out_tongue_winking_eye:

That said I definitely have some long shadows in my terminal as I don’t have any other live reload server going to my knowledge and after a reboot, the problem still occurs. I found this variable “sass”: true in ionic.project file and turning this to false allows me to run ‘ionic serve’ correctly.

I also had a sass build error the first time I ran ‘ionic setup sass’ which I solved by installing gulp manually and globally. Not sure if the problem is related to sass itself or ionic, I’ll dig into that today…

i found the bug,just now.
Win7: problems with spawned child processes.
why not fixed.

I also encountered the same issue as in the OP, when running ionic serve.
I also don’t have any other livereload/serve processes running.
This problem started after I set up the sass tools via ionic setup sass.
Looks like a bug.
And I agree, the error could use some more explicit description.

Other than that, Ionic rocks! :slight_smile:

setting sass variable to false solved my problem. thanks.

Where I can find this variable ?

The “sass” variable should be in the “iconic.project” file in your projects root directory.

Worked for me.

When you change sass to false, ionic doesn’t try to start up a separate process to watch the sass files. If you want changes to sass to be automatically incorporated, you can run “gulp sass watch” from your projects root directory. Do it in another window and leave it running.

In my case I had to remove

"gulpStartupTasks": [
  "sass",
  "watch"
],

from ionic.project to make the serve command work.
I hope this will get fixed soon.

I also have this problem. Aparently is the watch task that has a problem. It seem is a bug with Gaze, thats already fixed, but gulp can’t updated it yet. See this issue

I was able to solve this with my own install of gulp, following this: http://travismaynard.com/writing/getting-started-with-gulp

A solution would be to replace spawn by win-spawn:

  1. npm install win-spawn
  2. Replace the line in the Gruntfile.js:
    var spawn = require(‘child_process’).spawn;
    by
    var spawn = require(‘win-spawn’);

It is a quote from https://github.com/diegonetto/generator-ionic/issues/15