【问题标题】:spawn ENOENT node.js error产生 ENOENT node.js 错误
【发布时间】:2014-09-25 05:48:42
【问题描述】:

我已经使用 express-generator 启动了一个 node.js 应用程序,我有一个奇怪的问题,我无法通过浏览器查看页面两次,第一次加载正常,第二次加载不作为节点进程以以下错误结束:

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": "*"
  }
}

【问题讨论】:

  • 您能否提供访问该页面时执行的代码?您也可以尝试捕获异常并记录它以获取更多信息。见here
  • 这似乎与指南针模块的设置有关。当我注释掉这一行时,一切正常:// app.use(require('node-compass')({mode: 'expanded'}));
  • 并且compass 已安装/在您的路径中?您可以通过which compass 进行检查。这可以解释 ENOENT 部分......
  • node-compass readme 具有安装使用node-compass 所需的 compass ruby​​ gem 的命令。
  • Salem,你可能是对的,我只是假设 node-compass 是节点中指南针的实现,所以我不需要 ruby​​ gem。如果您将其发布为答案,我将给予您功劳。

标签: javascript node.js express express-generator


【解决方案1】:

Compass 没有安装在我的路径中,因为我认为节点库有一个 JS 实现。 对于有类似问题的人gem instal compass 应该解决它。 Compass Documentation

【讨论】:

  • 如果问题仍然存在,未来的访问者也可以尝试以下 QA。 stackoverflow.com/questions/27688804/…
  • 哇,那个错误没有表明指南针不在路径中......我很高兴我找到了这个!
猜你喜欢
  • 2013-07-30
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2017-10-23
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多