【问题标题】:GruntJS "bus error grunt watch"GruntJS“总线错误咕噜手表”
【发布时间】:2014-01-20 03:55:48
【问题描述】:

当我尝试运行 grunt watch 时,我遇到了 GruntJS 错误。 它工作正常,直到文件发生变化 看,然后,它看起来像这样:

Running "watch" task
Waiting...[1]    2464 bus error  grunt watch

2464 的数字发生了变化。似乎是 grunt 正在监视的端口?但是,我不确定。这是我的 Gruntfile:

module.exports = function (grunt) {
"use strict";

grunt.initConfig({
    pkg: grunt.file.readJSON('package.json'),
    sass: {
        dist: {
            options: {
                style: 'compact'
            },
            files: {
                'css/style.css': 'sass/style.scss',
            }
        }
    },
    watch: {
        files: 'sass/style.scss',
        tasks: ['sass']
    }
});

grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');

grunt.registerTask('default', ['sass']);
};

提前感谢所有帮助!

【问题讨论】:

    标签: command-line terminal sass gruntjs watch


    【解决方案1】:

    您使用 Osx 特立独行吗?

    结帐:https://github.com/gruntjs/grunt-contrib-watch/issues/204

    需要将node.js升级到0.10.22版本:

    # Check your version of Node.js. v0.10.20 will still be broken
    node –v
    
    # clean your node cache
    sudo npm cache clean –f
    
    # install node binary manager ’n’
    sudo npm install -g n
    
    # use said ’n’ manager to install latest stable version
    sudo n stable
    

    来源:http://stephentvedt.com/blog/2013/11/16/grunt-js-watch-bus-error/

    【讨论】:

    • 我实际上是在 OS X Mavericks 上,我会这样做看看会发生什么。不过,它看起来是对的。谢谢!
    • 这对我不起作用。我的节点是 v4.1.0,sudo n stable 将我设置为 4.0.0,我仍然在 gulp watch 上收到总线错误。仅供参考。
    【解决方案2】:

    sass 文件中的无效语法也会导致 grunt 或 gulp 以总线错误退出。如果您已经更新了节点并重新安装了模块但没有任何成功,请尝试运行 sass --watch <sass glob> 并查看是否有任何错误(可以安全地忽略导入循环作为原因)。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-01-10
      • 2014-03-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-19
      相关资源
      最近更新 更多