每當我做「咕嚕服務器」,它會自動給我這個錯誤:咕嚕服務器錯誤,EMFILE
Running "watch" task
Waiting...
Warning: EMFILE, too many open files
和未來這樣的:
(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.
這通常的處理辦法我已經看到了網絡上正在改變名稱如下所示:
grunt.registerTask('uglify', ['jshint', 'uglify']);
grunt.registerTask('myuglify', ['jshint', 'uglify']);
雖然我的問題不能用這種方法修復,因爲我不使用相同的名稱作爲任務。
我gruntfile.js:
module.exports = function(grunt){
grunt.initConfig({
sass: {
dist: {
files: {
'styles/css/main.css': 'styles/sass/main.scss'
}
}
}
,watch: {
options:{livereload:true},
sass:{
files:'styles/sass/*.scss',
tasks:'sass'
}
},
express:{
all:{
options:{
port:9000,
hostname:'localhost',
bases:'.',
livereload:true
}
}
}
});
grunt.loadNpmTasks('grunt-contrib-sass');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-express');
grunt.registerTask('default', ['sass'])
grunt.registerTask('server',['express','watch'])
}
任何想法?
爲什麼在'express'和'watch'配置中都有'livereload'?這是故意的嗎? – jsalonen 2014-09-29 18:04:05
是的,是的。因爲我希望它能夠重新加載。這就是教程所說的 – 2014-09-29 18:13:44