I've been looking the whole day to fix my issue.
My stack: - node 8.1.3 - yarn 1.9.4 - mac os x 10.13.6
In my package.json I have following dependency: "image-webpack-loader": "4.3.1",
This helps to load images in local webserver.
when I try to run 'yarn dev' to start the local webserver I get:
ERROR in ./src/assets/avatar.png Module build failed: Error: spawn /Users/pieter/projecten/react-redux-donderstarter-test/node_modules/optipng-bin/vendor/optipng ENOENT at exports._errnoException (util.js:1022:11) at Process.ChildProcess._handle.onexit (internal/child_process.js:189:19) at onErrorNT (internal/child_process.js:366:16) at _combinedTickCallback (internal/process/next_tick.js:102:11) at process._tickCallback (internal/process/next_tick.js:161:9) @ ./src/containers/HomePage/index.js 7:0-42 32:59-62 @ ./src/containers/App/routes.js @ ./src/containers/App/App.js @ ./src/containers/App/index.js @ ./src/index.js @ multi (webpack)-dev-server/client?http://0.0.0.0:9001 webpack/hot/dev-server ./src/index.js
So I've been reading lots of different 'solutions' and so I tried 'npm rebuild'
Output when I do 'npm rebuild':
optipng-bin@3.1.4 postinstall /Users/pieter/projecten/react-redux-donderstarter-test/node_modules/optipng-bin node lib/install.js
⚠ unable to verify the first certificate ⚠ optipng pre-build test failed ℹ compiling from source ✖ Error: ./configure --with-system-zlib --prefix="/Users/pieter/projecten/react-redux-donderstarter-test/node_modules/optipng-bin/vendor" --bindir="/Users/pieter/projecten/react-redux-donderstarter-test/node_modules/optipng-bin/vendor" && make install Command failed: make install pngrtran.c:98:1: warning: unused function 'png_rtran_ok' [-Wunused-function] png_rtran_ok(png_structrp png_ptr, int need_IHDR) ^ 1 warning generated. /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpng.a(pngpread.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpng.a(pngwtran.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpng.a(pngpread.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpng.a(pngwtran.o) has no symbols pngxmem.c:37:32: warning: result of comparison of constant 2305843009213693951 with expression of type 'png_uint_32' (aka 'unsigned int') is always false [-Wtautological-constant-out-of-range-compare] if (row_size == 0 || height > (pngx_alloc_size_t)(-1) / sizeof(png_bytep)) ~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1 warning generated. /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpngxtern.a(pngxio.o) has no symbols /Library/Developer/CommandLineTools/usr/bin/ranlib: file: libpngxtern.a(pngxio.o) has no symbols osys.c:515:25: error: no member named 'st_atim' in 'struct stat' times[0] = sbuf.st_atim; ~~~~ ^ osys.c:516:25: error: no member named 'st_mtim' in 'struct stat' times[1] = sbuf.st_mtim; ~~~~ ^ 2 errors generated. make[1]: * [osys.o] Error 1 make: * [install] Error 2
at ChildProcess.exithandler (child_process.js:270:12) at emitTwo (events.js:125:13) at ChildProcess.emit (events.js:213:7) at maybeClose (internal/child_process.js:897:16) at Process.ChildProcess._handle.onexit (internal/child_process.js:208:5)
I've been googling on the error and I found: https://sourceforge.net/p/optipng/bugs/68/ and appearently there's been a fix: https://github.com/macports/macports-ports/commit/f69d413bbcc4ed122933757146168c5103e6039f
I have no idea on how to proceed from here, to make my local situation work.
How to fix this annoying error? i'm really really stuck so any help would be greatly appreciated!