📅  最后修改于: 2023-12-03 15:15:13.443000             🧑  作者: Mango
Gatsby JS is a popular React-based static site generator. In order to start using Gatsby, you must first install it. This can be done using the 'gatsby-cli' package which can be downloaded and installed as a global package using 'npm'.
Before installing Gatsby JS, you should have the following prerequisites installed on your machine:
Follow these steps to install Gatsby JS using the 'gatsby-cli' package:
Open the terminal and run the following command to install the 'gatsby-cli' package globally:
npm install -g gatsby-cli
Once 'gatsby-cli' is installed, you can create a new Gatsby site using the 'gatsby new' command followed by your project name.
gatsby new my-gatsby-site
This command will create a new Gatsby site with the name 'my-gatsby-site'.
cd my-gatsby-site
Now we can run our site with this command:
gatsby develop
Once the Gatsby server has started up you can view your site in your browser at 'http://localhost:8000/'
Installing Gatsby JS and creating a new Gatsby site is fairly straightforward. By following the steps outlined above, you can quickly and easily install Gatsby and start building your static site.