When I run gulp
or gulp build
, or when I add an image to the assets/images folder when gulp watch
is running, I get the following error and gulp dies and dumps me to the command line:
[20:50:21] Using gulpfile /path/to/project/dev/site/web/app/themes/proj_name/gulpfile.js
[20:50:21] Starting 'build'...
[20:50:21] Starting 'wiredep'...
[20:50:22] Finished 'wiredep' after 444 ms
[20:50:22] Starting 'styles'...
[20:50:25] Finished 'styles' after 3.04 s
[20:50:25] Starting 'jshint'...
[20:50:25] Finished 'jshint' after 212 ms
[20:50:25] Starting 'scripts'...
[20:50:29] Finished 'scripts' after 4.6 s
[20:50:29] Starting 'fonts'...
[20:50:29] Starting 'images'...
child_process.js:1155
throw errnoException(err, 'spawn');
^
Error: spawn EACCES
at exports._errnoException (util.js:746:11)
at ChildProcess.spawn (child_process.js:1155:11)
at exports.spawn (child_process.js:988:9)
at exports.execFile (child_process.js:682:15)
at ExecBuffer.<anonymous> (/path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/exec-buffer/index.js:91:3)
at /path/to/project/dev/site/web/app/themes/proj_name/node_modules/wiredep/node_modules/bower-config/node_modules/graceful-fs/graceful-fs.js:104:5
at /path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-rev/node_modules/vinyl-file/node_modules/graceful-fs/graceful-fs.js:42:10
at FSReqWrap.oncomplete (fs.js:99:15)
Iāve read a few threads from people who seem to be having the same problem like this one: Gulp Error: spawn EACCES resulting from images added to asset folder. I tried deleting my node_modules
folder as it suggested and re-running npm install
it had no effect: I still get the exact same error.
I get some errors when I run npm install
that I think might be related, since they seem to have to do with gulp stuff that relates to images (warning, this is a long chunk of text):
ā gifsicle pre-build test failed [237/1382]
ā¹ compiling from source
ā gifsicle built successfully
npm WARN optional dep failed, continuing fsevents@0.3.6
> optipng-bin@3.0.2 postinstall /path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin
> node lib/install.js
ā Couldn't execute the `/path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-optipng/node_modules/optipng-bin/vendor/optipng` b
inary. Make sure it has the right permissions.
ā optipng pre-build test failed
ā¹ compiling from source
ā optipng built successfully
> jpegtran-bin@3.0.2 postinstall /path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin
> node lib/install.js
ā Couldn't execute the `/path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/vendor/jpegtran
` binary. Make sure it has the right permissions.
ā jpegtran pre-build test failed
ā¹ compiling from source
ā Error: ./configure --disable-shared --prefix="/path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpeg
tran-bin/vendor" --bindir="/path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bin/vendor" && mak
e install
Command failed: /bin/sh -c ./configure --disable-shared --prefix="/path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/n
ode_modules/jpegtran-bin/vendor" --bindir="/path/to/project/dev/site/web/app/themes/proj_name/node_modules/gulp-imagemin/node_modules/imagemin/node_modules/imagemin-jpegtran/node_modules/jpegtran-bi
n/vendor"
configure: error: no nasm (Netwide Assembler) found
at ChildProcess.exithandler (child_process.js:744:12)
at ChildProcess.emit (events.js:110:17)
at maybeClose (child_process.js:1008:16)
at Process.ChildProcess._handle.onexit (child_process.js:1080:5)
> pngcrush-bin@3.0.0 postinstall /path/to/project/dev/site/web/app/themes/proj_name/node_modules/imagemin-pngcrush/node_modules/pngcrush-bin
> node lib/install.js
ā Couldn't execute the `/path/to/project/dev/site/web/app/themes/proj_name/node_modules/imagemin-pngcrush/node_modules/pngcrush-bin/vendor/pngcrush` binary. Make sure it has the right permissions.
ā pngcrush pre-build test failed
ā¹ compiling from source
ā pngcrush built successfully