咕噜声“递归process.nextTick检测” [英] grunt throw "Recursive process.nextTick detected"

查看:97
本文介绍了咕噜声“递归process.nextTick检测”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用nodejs v0.10.26运行Lion 10.9.2

I'm running Lion 10.9.2 with nodejs v0.10.26

我想在sass文件上设置一个自动编译并用grunt实时重新加载,没有任何复杂但是...

I want to setup an automated compilation on sass files and a live reload with grunt, nothing complicated but...

运行 grunt watch 时出现以下错误:

When running grunt watch I get the following error

(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.

util.js:35
  var str = String(f).replace(formatRegExp, function(x) {
                      ^
RangeError: Maximum call stack size exceeded

这里是Gruntfile.js

here is the Gruntfile.js

module.exports = function(grunt) {

    // Project configuration.
    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),

        sass: {
            dist: {
                files: {
                    'assets/css/styles.css': 'assets/sass/styles.scss'
                }
            }
        },
        watch: {
            all: {
                files: 'index.html', // Change this if you are not watching index.html
                options: {
                    livereload: true  // Set livereload to trigger a reload upon change
                }
            },
            css: {
                files:  [ 'assets/sass/**/*.scss' ],
                tasks:  [ 'sass' ],
                options: {
                    spawn: false
                }
            },
            options: {
                livereload: true // Set livereload to trigger a reload upon change
            }
        }

    });

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

    grunt.registerTask('watch', [ 'watch']);

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

};

这里是package.json

and here is the package.json

{
  "name": "application",
  "version": "0.0.1",
  "private": true,
  "devDependencies": {
    "grunt": "~0.4.2",
    "grunt-contrib-watch": "~0.5.3",
    "grunt-contrib-sass": "~0.7.3"
  }
}


推荐答案

我终于想出了一个和SASS一样的问题。我正在使用

I finally figured out a similar problem I was having with SASS. I was using

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

诀窍是Grunt似乎不喜欢名字中的重复。当我切换到

The trick was that Grunt doesn't seem to like the repetition in names. When I switch to

grunt.registerTask('styles', [ 'sass']);

一切正常。

这篇关于咕噜声“递归process.nextTick检测”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆