OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Optipng Module build failed: Error: spawn

  • Thread starter Thread starter MackDoms
  • Start date Start date
M

MackDoms

Guest
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':

[email protected] 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

Code:
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!

<p>I've been looking the whole day to fix my issue.</p>

<p>My stack:
- node 8.1.3
- yarn 1.9.4
- mac os x 10.13.6</p>

<p>In my package.json I have following dependency:
"image-webpack-loader": "4.3.1",</p>

<p>This helps to load images in local webserver.</p>

<p>when I try to run 'yarn dev' to start the local webserver I get:</p>

<blockquote>
<p>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?<a href="http://0.0.0.0:9001" rel="nofollow noreferrer">http://0.0.0.0:9001</a> webpack/hot/dev-server
./src/index.js</p>
</blockquote>

<p>So I've been reading lots of different 'solutions' and so I tried 'npm rebuild'</p>

<p>Output when I do 'npm rebuild':</p>

<blockquote>
<blockquote>
<p>[email protected] postinstall /Users/pieter/projecten/react-redux-donderstarter-test/node_modules/optipng-bin
node lib/install.js</p>
</blockquote>

<p>⚠ 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]: <strong>* [osys.o] Error 1 make: *</strong> [install] Error 2</p>

<pre><code>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)
</code></pre>
</blockquote>

<p>I've been googling on the error and I found:
<a href="https://sourceforge.net/p/optipng/bugs/68/" rel="nofollow noreferrer">https://sourceforge.net/p/optipng/bugs/68/</a>
and appearently there's been a fix: <a href="https://github.com/macports/macports-ports/commit/f69d413bbcc4ed122933757146168c5103e6039f" rel="nofollow noreferrer">https://github.com/macports/macports-ports/commit/f69d413bbcc4ed122933757146168c5103e6039f</a></p>

<p>I have no idea on how to proceed from here, to make my local situation work.</p>

<p>How to fix this annoying error? i'm really really stuck so any help would be greatly appreciated!</p>
 

Latest posts

Top