gpt4 book ai didi

node.js - 咕噜声扔 "Recursive process.nextTick detected"

转载 作者:IT老高 更新时间:2023-10-28 21:48:23 25 4
gpt4 key购买 nike

我正在使用 nodejs v0.10.26 运行 Lion 10.9.2

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

运行 grunt watch 时出现以下错误

(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

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

{
"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 时遇到的类似问题。我正在使用

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

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

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

一切正常。

关于node.js - 咕噜声扔 "Recursive process.nextTick detected",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22285942/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com