This is a modern tool to build a multi-static blog using React and Webpack

install

  • It’s so easy

  • Erection of scaffolding,

    sudo npm install -g gatsby-cli

  • Create a directory

    sudo gatsby new my-blazing-fast-site

  • Start the

    cd my-blazing-fast-site/

    gatsby develop

But there will be a few potholes

  1. Sudo Gatsby new my-blazing-fast-sitecloneL A repository, and then executeyarn installYou may experience network outages herefatalError, or file too large adjust git package maximum orAdjust the host:
192.30 xx. Xx github.com 151.101. Xx. Xx github.global.ssl.fastly.netCopy the code

IP query address to improve the network

  1. sudo gatsby new my-blazing-fast-site

    • This will addsudoAdmin privileges, because it will be installed after clone does not add a permissions error
  2. LibPng this package will have an error similar

  • My islibpngnotlibpng-dev
> [email protected] postinstall C:\projects\my-blazing-fast-site\node_modules\pngquant-bin > node lib/install.js last year Command failed: C:\projects\my-blazing-fast-site\node_modules\pngquant-bin\vendor\pngquant.exe --version last year pngquant pre-buildtest 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 platformfor [email protected]: wanted {"os":"darwin"."arch":"any"} (current: {"os":"win32"."arch":"x64"})
Copy the code

Install the libpng package if it sounds familiar to anyone who has ever played Python

brew install libpng

Brew List check

Free walk

Then repack

Be sure to delete it before reinstalling it

rm-rf node_modules sudo yarn

  • Open the address bar:http://localhost:8000/___graphql
    • You can seegraphqlQuery interface of