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.
gatsby new my-blazing-fast-site
The project should be installed and ready to run develop command.
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
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
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
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