gpt4 book ai didi

node.js - Gulp-Imagemin 的 EACCES 错误

转载 作者:太空宇宙 更新时间:2023-11-04 00:50:34 25 4
gpt4 key购买 nike

我正在尝试执行 gulp 任务,但收到此错误:

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'));
});

最佳答案

这是一个权限错误。确保您拥有对所有这些文件和目录的读写访问权限。

关于node.js - Gulp-Imagemin 的 EACCES 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32685127/

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