Gatsby: Cannot build project becuase of missing libpng-dev library // WIN10

Created on 13 May 2019  Â·  4Comments  Â·  Source: gatsbyjs/gatsby

Description

When I'm trying to build a new project with gatsby-cli, I'm getting error:

Error: pngquant failed to build, make sure that libpng-dev is installed

The same thing happens when trying to npm install on different gatsby project, cloned from repo.

Steps to reproduce

  • install gatsby cli
  • run command to create new project:
gatsby new my-blazing-fast-site

Expected result

The project should be installed and ready to run develop command.

Actual result

Isnstalation stopped because of the error:

> [email protected] postinstall C:\projects\my-blazing-fast-site\node_modules\pngquant-bin
> node lib/install.js

  ‼ Command failed: C:\projects\my-blazing-fast-site\node_modules\pngquant-bin\vendor\pngquant.exe --version


  ‼ pngquant pre-build test failed
  i compiling from source
  × Error: pngquant failed to build, make sure that libpng-dev is installed
    at Promise.all.then.arr (C:\projects\my-blazing-fast-site\node_modules\execa\index.js:231:11)
    at processTicksAndRejections (internal/process/task_queues.js:86:5)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

[email protected] postinstall C:projectsmy-blazing-fast-sitenode_modulespngquant-bin
node lib/install.js

‼ Command failed: C:projectsmy-blazing-fast-sitenode_modulespngquant-binvendorpngquant.exe --version

‼ pngquant pre-build test failed
i compiling from source
× Error: pngquant failed to build, make sure that libpng-dev is installed
at Promise.all.then.arr (C:projectsmy-blazing-fast-sitenode_modulesexecaindex.js:231:11)
at processTicksAndRejections (internal/process/task_queues.js:86:5)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modulesfsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] postinstall: node lib/install.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:UsersMaciekAppDa

Environment

System:
OS: Windows 10
CPU: (4) x64 Intel(R) Core(TM) i7-5500U CPU @ 2.40GHz
Binaries:
Yarn: 1.16.0 - C:Program Files (x86)Yarnbinyarn.CMD
npm: 6.7.0 - C:Program Filesnodejsnpm.CMD
Browsers:
Edge: 44.17763.1.0
npmPackages:
gatsby: ^2.3.5 => 2.3.5
gatsby-image: ^2.0.37 => 2.0.37
gatsby-plugin-manifest: ^2.0.26 => 2.0.26
gatsby-plugin-offline: ^2.0.25 => 2.0.25
gatsby-plugin-react-helmet: ^3.0.11 => 3.0.11
gatsby-source-filesystem: ^2.0.28 => 2.0.28
gatsby-transformer-sharp: ^2.1.17 => 2.1.17

awaiting author response

Most helpful comment

Could you try using troubleshooting instructions on https://www.gatsbyjs.org/docs/gatsby-on-windows/ ? If that doesn't help will try to debug from there

All 4 comments

Could you try using troubleshooting instructions on https://www.gatsbyjs.org/docs/gatsby-on-windows/ ? If that doesn't help will try to debug from there

Thanks @pieh I wasn't aware of that guide, I'll give it a go :)

Hey @pieh , cheers for that. I've installed windows-build-tools and that fixed it.

how fixed ? It doesn't work on my pc

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jimfilippou picture jimfilippou  Â·  3Comments

ferMartz picture ferMartz  Â·  3Comments

ghost picture ghost  Â·  3Comments

Oppenheimer1 picture Oppenheimer1  Â·  3Comments

theduke picture theduke  Â·  3Comments