2015-09-20 67 views
1

我試圖讓一飲而盡任務的工作,但我得到這個錯誤:EACCES錯誤與咕嘟咕嘟-Imagemin

events.js:72 
     throw er; // Unhandled 'error' event 
      ^
Error: spawn EACCES 
    at errnoException (child_process.js:988:11) 
    at Process.ChildProcess._handle.onexit (child_process.js:779:34) 

它沒有說太多關於錯誤本身,所以我安裝「的SuperStack 「並得到了這個:

events.js:72 
     throw er; // Unhandled 'error' event 
      ^
Error: spawn EACCES 
    at errnoException (child_process.js:988:11) 
    at Process.ChildProcess._handle.onexit (child_process.js:779:34) 
    at DuplexWrapper.Readable.on (/var/www/public/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/stream-combiner2/node_modules/duplexer2/node_modules/readable-stream/lib/_stream_readable.js:703:33) 
    at Imagemin.run (/var/www/public/node_modules/gulp-imagemin/node_modules/imagemin/index.js:80:9) 
    at DestroyableTransform.through.obj.percent (/var/www/public/node_modules/gulp-imagemin/index.js:56:12) 
    at DestroyableTransform._transform (/var/www/public/node_modules/gulp-imagemin/node_modules/through2-concurrent/through2-concurrent.js:29:15) 
    at DestroyableTransform.Transform._read (/var/www/public/node_modules/gulp-imagemin/node_modules/through2-concurrent/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:10) 
    at DestroyableTransform.Transform._write (/var/www/public/node_modules/gulp-imagemin/node_modules/through2-concurrent/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:160:12) 
    at doWrite (/var/www/public/node_modules/gulp-imagemin/node_modules/through2-concurrent/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:326:12) 
    at writeOrBuffer (/var/www/public/node_modules/gulp-imagemin/node_modules/through2-concurrent/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:312:5) 

任何想法,爲什麼我得到這個錯誤?我能做些什麼來解決它?

非常感謝!

編輯:

這是我試圖運行任務。

gulp.task('build-images', function(){ 
    return gulp.src('app/assets/src/**/*.+(png|jpg|gif|jpeg)') 
     .pipe($.debug({title:'BEFORE'})) 
     .pipe(imagemin({ 
      progressive: true, 
      svgoPlugins: [{removeViewBox: false}], 
      use: [pngquant()] 
     })) 
     .pipe($.debug({title:'AFTER'})) 
     .pipe(gulp.dest('dest/images')); 
}); 
+0

確保目錄和文件存在 – aug2uag

+0

請檢查此屏幕截圖:http://s8.postimg.org/9d62x8pat/image.png – EzeTeja

+0

我遇到同樣的問題。我可以使用一些幫助。 – Dharmaputhiran

回答

1

這是一個權限錯誤。確保您具有讀取和寫入所有這些文件和目錄的權限。

+0

請檢查以下屏幕截圖:http://s8.postimg.org/9d62x8pat/image.png – EzeTeja

+0

我是所有者,並且擁有讀寫權限,但由於某種原因,我一直有相同的錯誤信息,於是我意識到我沒有執行任務,所以我試圖用chmod改變它,但沒有成功。由於它是一個Vagrant框,我在Vagrantfile中更改了這一行,現在它可以工作。 '''config.vm.synced_folder「。」,「/ var/www」,::mount_options => [「dmode = 777」,「fmode = 777」]''' – EzeTeja