Gatsby default starter

Viewed 217

This error came when I created gatsby-default-starter site. How to solve it. What is the problem with it?

Error message:

‼ pngquant pre-build test failed i compiling from source × Error: pngquant failed to build, make sure that libpng-dev is installed at D:\gatsby-project\my-gatsby-project\node_modules\bin-build\node_modules\execa\index.js:231:11 at runMicrotasks () at processTicksAndRejections (internal/process/task_queues.js:93:5) at async Promise.all (index 0) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules\webpack-dev-server\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.3.2 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.3.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pngquant-bin@6.0.0 postinstall: node lib/install.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pngquant-bin@6.0.0 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:

ERROR

Command failed with exit code 1: npm install

Error: Command failed with exit code 1: npm install

error.js:56 makeError [npm]/[gatsby-cli]/[execa]/lib/error.js:56:11

index.js:114 handlePromise [npm]/[gatsby-cli]/[execa]/index.js:114:26

task_queues.js:93 processTicksAndRejections internal/process/task_queues.js:93:5

init-starter.js:135 install [npm]/[gatsby-cli]/lib/init-starter.js:135:7

init-starter.js:202 clone [npm]/[gatsby-cli]/lib/init-starter.js:202:3

init-starter.js:343 initStarter [npm]/[gatsby-cli]/lib/init-starter.js:343:5

create-cli.js:494 [npm]/[gatsby-cli]/lib/create-cli.js:494:9
1 Answers

It seems that you are using Windows as OS. This issue is usually related to some additional dependencies that you may need. Try the following:

  • Delete your project (to avoid potentially corrupted dependencies).

  • Install the windows-build-tools by:

    npm install --global windows-build-tools --vs2015
    
  • Run your starter command and develop it. For example:

    npm install -g gatsby-cli
    
    gatsby new gatsby-site
    
    cd gatsby-site
    
    gatsby develop
    
  • If the issue persists try installing manually the missing dependencies by:

    npm install imagemin-pngquant@5.0.1 --save
    
    npm install pngquant-bin@3.1.1 --save
    

For further details check Gatsby on Windows docs.

Related