Gulp 错误内部/child_process.js:298 throw errnoException(err, 'spawn');错误:产生 EACCES [英] Gulp error internal/child_process.js:298 throw errnoException(err, 'spawn'); Error: spawn EACCES
问题描述
我搜索了这个错误的原因,发现我必须更改权限或使用 sudo 运行 gulp,但仍然得到同样的错误.谁能帮忙...
I searched for the cause of this error and found that I have to change permissions or run gulp using sudo, but still got the same error. Can anyone please help...
内部/child_process.js:298抛出 errnoException(err, 'spawn');^
internal/child_process.js:298 throw errnoException(err, 'spawn'); ^
错误:产生 EACCES在exports._errnoException (util.js:870:11)在 ChildProcess.spawn (internal/child_process.js:298:11)在exports.spawn (child_process.js:362:9)在exports.execFile (child_process.js:151:15)在执行缓冲区.(/var/www/conFusion/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/exec-buffer/index.js:91:3)在/var/www/conFusion/node_modules/gulp-rev/node_modules/vinyl-file/node_modules/graceful-fs/graceful-fs.js:42:10在/var/www/conFusion/node_modules/gulp-cache/node_modules/cache-swap/node_modules/graceful-fs/graceful-fs.js:42:10在/var/www/conFusion/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/vinyl-fs/node_modules/graceful-fs/graceful-fs.js:42:10在 FSReqWrap.oncomplete (fs.js:82:15)
Error: spawn EACCES at exports._errnoException (util.js:870:11) at ChildProcess.spawn (internal/child_process.js:298:11) at exports.spawn (child_process.js:362:9) at exports.execFile (child_process.js:151:15) at ExecBuffer. (/var/www/conFusion/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/exec-buffer/index.js:91:3) at /var/www/conFusion/node_modules/gulp-rev/node_modules/vinyl-file/node_modules/graceful-fs/graceful-fs.js:42:10 at /var/www/conFusion/node_modules/gulp-cache/node_modules/cache-swap/node_modules/graceful-fs/graceful-fs.js:42:10 at /var/www/conFusion/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/vinyl-fs/node_modules/graceful-fs/graceful-fs.js:42:10 at FSReqWrap.oncomplete (fs.js:82:15)
推荐答案
您似乎没有权限运行某些文件,尝试在项目的根路径上输入下一个命令:
It looks like you don't have permission to run some files, Try by typing next command on the root path of your project:
chmod -R u+x .
如果现在已修复,您必须找出哪些文件的权限不正确.如果要撤消更改以查找那些有问题的文件,请键入下一条命令:
If it is fixed now you must find which files had the incorrect permissions. Type next command if you want to undo changes to find those problematic files:
git checkout -- .
这篇关于Gulp 错误内部/child_process.js:298 throw errnoException(err, 'spawn');错误:产生 EACCES的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!