本文介绍了产生ENOENT node.js错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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

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


推荐答案

我的路径中没有安装指南针,因为我假设节点库有一个JS实现。
对于任何有类似问题的人,您应该修复它。 gem instal compass

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

这篇关于产生ENOENT node.js错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

05-28 11:27
查看更多