6

I have started a node.js app with the express-generator, I have a strange issue where I can't view a page via the browser twice, first time it loads fine, second time it doesn't as the node process ends with the following error:

GET / 304 412ms

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

package.json

{
  "name": "example01-express",
  "version": "0.0.1",
  "private": true,
  "scripts": {
    "start": "node-dev ./bin/www"
  },
  "dependencies": {
    "body-parser": "~1.0.0",
    "cookie-parser": "~1.0.1",
    "debug": "~0.7.4",
    "express": "~4.2.0",
    "jade": "~1.3.0",
    "morgan": "~1.0.0",
    "node-compass": "0.2.3",
    "static-favicon": "~1.0.0"
  },
  "devDependencies": {
    "grunt": "^0.4.5",
    "grunt-contrib-cssmin": "*",
    "grunt-contrib-jshint": "^0.10.0",
    "grunt-contrib-sass": "*",
    "grunt-contrib-uglify": "*",
    "grunt-contrib-watch": "*",
    "grunt-cssc": "*",
    "grunt-htmlhint": "*",
    "matchdep": "*"
  }
}
filype
  • 8,034
  • 10
  • 40
  • 66
  • Can you provide the code that is executed when you access that page? Also you can try to catch the exception and log it to get more information. See [here](http://expressjs.com/guide.html#error-handling). – Salem Aug 01 '14 at 23:55
  • 1
    This seems to be related with setup of compass module. When I commented out this line everything worked fine: `// app.use(require('node-compass')({mode: 'expanded'}));` – filype Aug 02 '14 at 00:33
  • 1
    And `compass` is installed/in your path? You can check it with `which compass`. That could explain the ENOENT part... – Salem Aug 02 '14 at 00:43
  • 1
    The [node-compass readme](https://github.com/nathggns/node-compass#requirements) has the commands to install the compass ruby gem needed to use `node-compass`. – mscdex Aug 02 '14 at 01:26
  • Salem, you're probably right I just assumed `node-compass` was an implementation of compass in node so I didn't need the ruby gem. if you post it as an answer I will give you the credit for it. – filype Aug 02 '14 at 04:05
  • This worked for me: https://stackoverflow.com/a/65008091/8119511 – Ank_247shbm Mar 03 '22 at 19:21

1 Answers1

8

Compass was not installed in my path as I assumed the node library had a JS implementation of it. For whoever has a similar issue gem instal compass should fix it. Compass Documentation

filype
  • 8,034
  • 10
  • 40
  • 66
  • Future visitors can also try the following QA if problem persists. http://stackoverflow.com/questions/27688804/how-to-debug-any-node-js-child-process-error-spawn-enoent – laconbass Dec 29 '14 at 13:24
  • Wow, that error did _not_ ellude to compass not being in the path... I'm so glad I found this! – mrClean Jun 24 '17 at 03:50