我正在尝试在OS X Yosemite 10.5.5上使用插件gulp-compass运行以下Gulp任务来编译Sass文件。

var path = require("path");
var gulp = require("gulp");
var compass = require("gulp-compass");

gulp.task("compile2013Base", function() {
    var projectPath = path.join(__dirname, '../../ ');

    gulp.src(['../sass/desktop/css/2013/*.scss']).pipe(compass({
        project: projectPath,
        css: 'htdocs/assets/css/2013/',
        sass: 'sass/desktop/css/2013'
    })).on('error', errorHandler).pipe(gulp.dest('../../htdocs/assets/css/2013/'));
});

function errorHandler (error) {
  console.log(error.toString());
  this.emit('end');
 }


但是,当我尝试运行gulp compile2013Base之类的任务时,出现以下错误:

> gulp compile2013Base
[13:39:06] Using gulpfile [**redacted**]/scripts/js/gulpfile.js
[13:39:06] Starting 'compile2013Base'...
[13:39:06] Finished 'compile2013Base' after 9.07 ms
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: spawn /usr/bin/compass ENOENT
    at exports._errnoException (util.js:746:11)
    at Process.ChildProcess._handle.onexit (child_process.js:1053:32)
    at child_process.js:1144:20
    at process._tickCallback (node.js:355:11)


我已经在/ usr / bin / compass中安装了指南针,并且在终端中运行compass不会显示任何错误。
我不确定该怎么办,如何获取错误详细信息?

最佳答案

这对我有帮助

sudo gem install -n /usr/local/bin compass

Error: "compass:dist" Fatal error: spawn /usr/bin/compass ENOENT

关于node.js - 使用gulp-compass时出现“错误:生成/usr/bin/compass ENOENT”,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/33401368/

10-15 21:40