Everything starts with Sharp. Sharp is a very popular image processing library on the Node.js platform. It is actually packaged based on the libvips library written in C language. It can implement image editing operations, such as cropping, format conversion, rotation transformation, and filter addition. Believe me, please see the official document
Because Sharp is a native Node module, a compilation environment needs to be built in the windows system. The recommended way is to install windows-build-tools
-
Open a PowerShell terminal as an administrator Admin
-
Run the following command:
npm install --global windows-build-tools --vs2015
-
This command will download and install Visual C++ Build Tools 2015, which is used to compile popular native modules
-
This command also downloads Python 2.7, sets up the computer and the environment like npm
Note, this process took me over 3 hours here...be patient
Installation experience:
Reinstall this environment on the company computer on March 24, 2021. It only takes 5 minutes to complete the download, installation and environment configuration.
Continue to run gatsby develop, but also encountered a problem:
Couldn't find the “gatsby-transformer-sharp” plugin declared in “D:\code\valsedefleurs\gatsby-config.js”.
Tried looking for a local plugin in D:\code\valsedefleurs\plugins\gatsby-transformer-sharp.
You need to download and install the gatsby-transformer-sharp package