C:\Users\lenovo>npm install -g gatsby-cli npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. C:\Users\lenovo\AppData\Roaming\npm\gatsby -> C:\Users\lenovo\AppData\Roaming\npm\node_modules\gatsby-cli\lib\index.js
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
╔════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ Gatsby collects anonymous usage analytics ║ ║ to help improve Gatsby for all users. ║ ║ ║ ║ If you'd like to opt-out, you can use `gatsby telemetry --disable` ║ ║ To learn more, checkout https://gatsby.dev/telemetry ║ ║ ║ ╚════════════════════════════════════════════════════════════════════════╝
╔════════════════════════════════════════════════════════════════════════╗ ║ ║ ║ Gatsby collects anonymous usage analytics ║ ║ to help improve Gatsby for all users. ║ ║ ║ ║ If you'd like to opt-out, you can use `gatsby telemetry --disable` ║ ║ To learn more, checkout https://gatsby.dev/telemetry ║ ║ ║ ╚════════════════════════════════════════════════════════════════════════╝ Success!
Welcome to the Gatsby CLI! Please visit https://www.gatsbyjs.org/docs/gatsby-cli/ for more information.
Usage: gatsby <command> [options]
Commands: gatsby develop Start development server. Watches files, rebuilds, and hot reloads if something changes gatsby build Build a Gatsby project. gatsby serve Serve previously built Gatsby site. gatsby info Get environment information for debugging and issue reporting gatsby clean Wipe the local gatsby environment including built assets and cache gatsby repl Get a node repl with context of Gatsby environment, see (https://www.gatsbyjs.org/docs/gatsby-repl/) gatsby new [rootPath] [starter] Create new Gatsby project. gatsby plugin Useful commands relating to Gatsby plugins gatsby telemetry Enable or disable Gatsby anonymous analytics collection.
Options: --verbose Turn on verbose output [boolean] [default: false] --no-color, --no-colors Turn off the color in output [boolean] [default: false] --json Turn on the JSON logger [boolean] [default: false] -h, --help Show help [boolean] -v, --version Show the version of the Gatsby CLI and the Gatsby package in the current project [boolean] npm WARN ink@2.6.0 requires a peer of @types/react@>=16.8.0 but none is installed. You must install peer dependencies yourself. npm WARN auto-bind@3.0.0 requires a peer of @types/react@>=16.8.0 but none is installed. You must install peer dependencies yourself.
+ gatsby-cli@2.8.22 added 376 packages from 164 contributors in 76.778s
首先在本机创建一个文件夹用于存放网页,然后执行新建命令gatsby new [sitename] [模版路径],gatsbyjs会通过git去下载模版并创建项目。创建完成后会自动安装,但是可能会安装失败,因为默认npm的镜像地址会被我们的大型局域网屏蔽,我们可以借助nrm来管理镜像地址。我在安装过程中,遇到了
E:\gatsbyjs>gatsby new happylife https://github.com/greglobinski/gatsby-starter-hero-blog info Creating new site from git: https://github.com/greglobinski/gatsby-starter-hero-blog.git Cloning into 'happylife'... remote: Enumerating objects: 197, done. remote: Counting objects: 100% (197/197), done. remote: Compressing objects: 100% (159/159), done. remote: Total 197 (delta 16), reused 150 (delta 11), pack-reused 0 eceiving objects: 100% (197/197), 8.79 MiB | 71.00 KiReceiving objects: 100% (197/197), 8.83 MiB | 58.00 KiB/s, done.
Resolving deltas: 100% (16/16), done. success Created starter directory layout info Installing packages... npm WARN deprecated postcss-cssnext@3.1.0: 'postcss-cssnext' has been deprecated in favor of 'postcss-preset-env'. Read more at https://moox.io/blog/deprecating-cssnext/ npm WARN deprecated bfj-node4@5.3.1: Switch to the `bfj` package for fixes and new features! npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. npm WARN deprecated md5-file@3.2.3: This module is looking for a new maintainer. npm WARN deprecated browserslist@2.11.3: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3. npm WARN deprecated browserslist@1.7.7: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools. npm WARN deprecated hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial). npm WARN deprecated circular-json@0.3.3: CircularJSON is in maintenance only, flatted is its successor. npm WARN deprecated @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
info sharp Using cached C:\Users\lenovo\AppData\Roaming\npm-cache\_libvips\libvips-8.8.1-win32-x64.tar.gz info sharp Creating E:\gatsbyjs\happylife\node_modules\sharp\build\Release info sharp Copying DLLs from E:\gatsbyjs\happylife\node_modules\sharp\vendor\lib to E:\gatsbyjs\happylife\node_modules\sharp\build\Release
info sharp Using cached C:\Users\lenovo\AppData\Roaming\npm-cache\_libvips\libvips-8.8.1-win32-x64.tar.gz info sharp Creating E:\gatsbyjs\happylife\node_modules\sharp-cli\node_modules\sharp\build\Release info sharp Copying DLLs from E:\gatsbyjs\happylife\node_modules\sharp-cli\node_modules\sharp\vendor\lib to E:\gatsbyjs\happylife\node_modules\sharp-cli\node_modules\sharp\build\Release
Thank you for using core-js ( https://github.com/zloirock/core-js ) for polyfilling JavaScript standard library!
The project needs your help! Please consider supporting of core-js on Open Collective or Patreon: > https://opencollective.com/core-js > https://www.patreon.com/zloirock
Also, the author of core-js ( https://github.com/zloirock ) is looking for a good job -)
npm notice created a lockfile as package-lock.json. You should commit this file. npm WARN gatsby-plugin-styled-jsx@3.1.17 requires a peer of styled-jsx@^3.0.2 but none is installed. You must install peer dependencies yourself. npm WARN react-addons-perf@15.4.2 requires a peer of react-dom@^15.4.2 but none is installed. You must install peer dependencies yourself. npm WARN eslint-config-react-app@5.1.0 requires a peer of babel-eslint@10.x but none is installed. You must install peer dependencies yourself. npm WARN eslint-config-react-app@5.1.0 requires a peer of eslint@6.x but none is installed. You must install peer dependencies yourself. npm WARN tsutils@3.17.1 requires a peer of typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta but none is installed. You must install peer dependencies yourself. npm WARN ws@7.2.1 requires a peer of bufferutil@^4.0.1 but none is installed. You must install peer dependencies yourself. npm WARN ws@7.2.1 requires a peer of utf-8-validate@^5.0.2 but none is installed. You must install peer dependencies yourself. npm WARN react-instantsearch-native@5.7.0 requires a peer of react-native@>= 0.32.0 but none is installed. You must install peer dependencies yourself. npm WARN eslint-plugin-graphql@2.1.1 requires a peer of graphql@^0.12.0 || ^0.13.0 but none is installed. You must install peer dependencies yourself. npm WARN gatsby-starter-hero-blog@2.0.0 No repository field. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\chokidar\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
added 3046 packages from 1481 contributors in 1263.674s
56 packages are looking for funding run `npm fund` for details
info Initialising git in happylife Initialized empty Git repository in E:/gatsbyjs/happylife/.git/ info Create initial git commit in happylife info Your new Gatsby site has been successfully bootstrapped. Start developing it by running: