Вот полный проект на Github
Я запускаю gatsby develop
, а вот полный вывод консоли
gatsby develop
success open and validate gatsby-configs - 0.042s
success load plugins - 0.462s
success onPreInit - 0.012s
success initialize cache - 0.045s
success copy gatsby files - 0.240s
success onPreBootstrap - 0.062s
success createSchemaCustomization - 0.018s
success source and transform nodes - 0.165s
success building schema - 0.502s
success createPages - 0.066s
success createPagesStatefully - 0.334s
success onPreExtractQueries - 0.004s
success update schema - 0.069s
success extract queries from components - 0.204s
success write out requires - 0.043s
success write out redirect data - 0.012s
success onPostBootstrap - 0.011s
⠀
info bootstrap finished - 10.645 s
⠀
success run queries - 0.047s - 3/3 63.54/s
ERROR #98123 WEBPACK
Generating SSR bundle failed
Cannot find module '@babel/core'
Require stack:
- /Dir/node_modules/@babel/plugin-transform-react-jsx/lib/transform-classic.js
- /Dir/node_modules/@babel/plugin-transform-react-jsx/lib/index.js
- /Dir/node_modules/@emotion/babel-preset-css-prop/dist/babel-preset-css-prop.cjs.dev.js
- /Dir/node_modules/@emotion/babel-preset-css-prop/dist/babel-preset-css-prop.cjs.js
- /Dir/tutorial-part-four/node_modules/@babel/core/lib/config/files/plugins.js
- /Dir/tutorial-part-four/node_modules/@babel/core/lib/config/files/index.js
- /Dir/tutorial-part-four/node_modules/@babel/core/lib/index.js
- /Dir/tutorial-part-four/node_modules/babel-loader/lib/index.js
- /Dir/tutorial-part-four/node_modules/gatsby/dist/utils/babel-loader.js
- /Dir/tutorial-part-four/node_modules/loader-runner/lib/loadLoader.js
- /Dir/tutorial-part-four/node_modules/loader-runner/lib/LoaderRunner.js
- /Dir/tutorial-part-four/node_modules/webpack/lib/NormalModule.js
- /Dir/tutorial-part-four/node_modules/webpack/lib/NormalModuleFactory.js
- /Dir/tutorial-part-four/node_modules/webpack/lib/Compiler.js
- /Dir/tutorial-part-four/node_modules/webpack/lib/webpack.js
- /Dir/tutorial-part-four/node_modules/gatsby/dist/commands/develop.js
- ~/.config/yarn/global/node_modules/gatsby-cli/lib/create-cli.js
- ~/.config/yarn/global/node_modules/gatsby-cli/lib/index.js
File: .cache/develop-static-entry.js
———————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————————
3 pages Failed gatsby-starter-hello-world
Неудачные попытки до сих пор
Я пытался удалить .cache
, node_modules
yarn.lock/package-lock.json
и переустановка. Я попробовал это, используя и npm
и yarn
(отдельно, никогда вместе), и обновляя пряжу, и узел
Я также попытался
rm ~/Library/Yarn/Caches/
yarn add @babel/core
и получил
yarn add @babel/core
yarn add v1.22.4
warning ../package.json: No license field
[1/4] ? Resolving packages...
[2/4] ? Fetching packages...
warning Pattern ["@babel/core@^7.9.0"] is trying to unpack in the same destination "~/Library/Caches/Yarn/v6/npm-@babel-core-7.9.0-ac977b538b77e132ff706f3b8a4dbad09c03c56e-integrity/node_modules/@babel/core" as pattern ["@babel/core@^7.8.7"]. This could result in non-deterministic behavior, skipping.
warning url-loader@1.1.2: Invalid bin field for "url-loader".
[3/4] ? Linking dependencies...
[4/4] ? Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ @babel/core@7.9.0
info All dependencies
└─ @babel/core@7.9.0
✨ Done in 164.67s.
Версия пряжи и Гэтсби
yarn --version
1.22.4
node --version
v13.13.0
gatsby --version
Gatsby CLI version: 2.11.7
Gatsby version: 2.20.20
Note: this is the Gatsby version for the site at: /Dir/tutorial-part-four
упаковка. json
{
"name": "gatsby-starter-hello-world",
"private": true,
"description": "A simplified bare-bones starter for Gatsby",
"version": "0.1.0",
"license": "MIT",
"scripts": {
"build": "gatsby build",
"develop": "gatsby develop",
"format": "prettier --write \"**/*.{js,jsx,json,md}\"",
"start": "npm run develop",
"serve": "gatsby serve",
"clean": "gatsby clean",
"test": "echo \"Write tests! -> https://gatsby.dev/unit-testing\" && exit 1"
},
"dependencies": {
"@babel/core": "^7.9.0",
"@types/react": "^16.0.0",
"core-js": "3",
"gatsby": "^2.20.12",
"gatsby-source-filesystem": "^2.2.2",
"react": "^16.12.0",
"react-dom": "^16.12.0",
"typescript": "^3.9.0-dev.20200414"
},
"devDependencies": {
"prettier": "^1.19.1"
},
"repository": {
"type": "git",
"url": "https://github.com/gatsbyjs/gatsby-starter-hello-world"
},
"bugs": {
"url": "https://github.com/gatsbyjs/gatsby/issues"
}
}