PC規格: Windows 7企業64咕嚕觀看致命錯誤:聽EACCES和livereload
我的一個項目運行grunt.js和最近開始收到錯誤嘗試運行「咕嚕表」時。
咕嚕昨天精細的工作,但現在我開始看到:
運行「監視」任務 等待...致命錯誤:聽EACCES
我讀到這裏的另一個問題:Cloud 9 and Grunt.js
導致我從Gruntfile.js刪除'選項:{livereload:true}'
運行監視再次按預期工作。有沒有辦法重新配置grunt或livereload以再次使用Grunt進行livereload工作?
此外,只要運行命令'grunt'即可運行所有任務而不會出錯。
謝謝。
編輯:Gruntfile.js如下:
module.exports = function(grunt) {
grunt.initConfig({
jshint: {
all: ['js/src/*.js']
},
uglify: {
options: {
mangle: {
except: ['jQuery']
},
preserveComments: 'none'
},
'js/main.min.js': ['js/tmp/debug.js']
},
compass: {
options: {
config: '.compass.rb',
sassDir: 'sass',
cssDir: '.'
},
my_target: {
}
},
cmq: {
my_target: {
files: { 'tmp': ['style.css'] }
}
},
cssmin: {
minify: {
keepSpecialComments: 0,
expand: true,
cwd: 'tmp/',
src: ['style.css'],
dest: '.',
ext: '.css'
}
},
imagemin: {
png: {
options: {
optimizationLevel: 7
},
files: [{
expand: true,
cwd: 'img',
src: ['**/*.png'],
dest: 'img',
ext: '.min.png'
}]
},
jpg: {
options: {
progressive: true
},
files: [{
expand: true,
cwd: 'img',
src: ['**/*.jpg'],
dest: 'img',
ext: '.min.jpg'
}]
},
gif: {
options: {
progressive: true
},
files: [{
expand: true,
cwd: 'img',
src: ['**/*.gif'],
dest: 'img',
ext: '.min.gif'
}]
}
},
clean: ["tmp"],
watch: {
scripts: {
files: 'js/src/*.js',
tasks: ['jshint', 'concat', 'uglify', 'clean'],
options: { livereload: true }
},
css: {
files: 'sass/*.scss',
tasks: ['compass', 'cmq', 'cssmin', 'clean'],
options: { livereload: true }
}
},
concat: {
debug: {
src: ['js/src/**/*.js'],
dest: 'js/tmp/debug.js'
}
},
});
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-contrib-jshint');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-uglify');
grunt.loadNpmTasks('grunt-contrib-compass');
grunt.loadNpmTasks('grunt-combine-media-queries');
grunt.loadNpmTasks('grunt-contrib-cssmin');
grunt.loadNpmTasks('grunt-contrib-clean');
grunt.loadNpmTasks('grunt-contrib-imagemin');
grunt.registerTask('default', ['jshint', 'concat', 'uglify', 'compass', 'cmq', 'cssmin', 'clean']);
}
'grunt'和'咕嚕-的contrib-watch'的哪個版本的哪個版本? – Mathletics
「grunt」:「〜0.4.2」 「grunt-contrib-watch」:「〜0.5.3」 – Sean
你可以發佈你的Gruntfile嗎? – Mathletics