盖茨比(Gatsby)生产失败 [英] Gatsby failing production build
问题描述
最近,盖茨比(Gatsby)开始无法构建该网站的生产版本.开发版本构建良好.
Recently, Gatsby started failing to build a production version of the site. Development version builds fine.
这似乎是通天塔的问题,但我不知道这是什么.我已经升级了所有内容,删除了node_modules文件夹和yarn.lock,但是在重新构建所有内容之后,它以相同的方式失败.
It seems to be some Babel issue but I can't figure out what it is. I've upgraded everything, deleted the node_modules folder and yarn.lock but after building everything afresh again it fails the same way.
我对Babel的内部运作方式不是特别熟悉,所以我猜想这与Gatsby随附的Babel设置有关吗?
I'm not particularly familiar with the inner workings Babel so I'm guessing this is something to do with the Babel settings shipped with Gatsby?
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@fortawesome/react-fontawesome/index.es.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/@fortawesome/react-fontawesome/index.es.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@mikaelkristiansson/domready/ready.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/@mikaelkristiansson/domready/ready.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@reach/router/es/index.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/@reach/router/es/index.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@reach/router/es/lib/utils.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/@reach/router/es/lib/utils.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby-link/index.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/gatsby-link/index.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby-react-router-scroll/index.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/gatsby-react-router-scroll/index.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/lodash/lodash.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/lodash/lodash.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/mitt/dist/mitt.es.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/mitt/dist/mitt.es.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/netlify-identity-widget/build/netlify-identity.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/netlify-identity-widget/build/netlify-identity.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/prop-types/index.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/prop-types/index.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-add-to-calendar/dist/react-add-to-calendar.min.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/react-add-to-calendar/dist/react-add-to-calendar.min.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-dom/index.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/react-dom/index.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-helmet/lib/Helmet.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/react-helmet/lib/Helmet.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-image-gallery/build/image-gallery.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/react-image-gallery/build/image-gallery.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react-share/es/index.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/react-share/es/index.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/react/index.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/react/index.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
[BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/shallow-compare/es/index.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
File: node_modules/shallow-compare/es/index.js
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
at Array.reduce (<anonymous>)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
at process._tickCallback (internal/process/next_tick.js:61:11)
File: src/components/share.scss
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
at Array.reduce (<anonymous>)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
at process._tickCallback (internal/process/next_tick.js:61:11)
File: node_modules/react-add-to-calendar/dist/react-add-to-calendar.css
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
at Array.reduce (<anonymous>)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
at process._tickCallback (internal/process/next_tick.js:61:11)
File: node_modules/react-image-gallery/styles/css/image-gallery.css
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
at Array.reduce (<anonymous>)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
at process._tickCallback (internal/process/next_tick.js:61:11)
File: src/templates/gallery.css
ERROR #98123 WEBPACK
Generating JavaScript bundles failed
Module build failed (from ./node_modules/gatsby/node_modules/babel-loader/lib/index.js):
Error: [BABEL] /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/css-loader/lib/css-base.js: Invalid Option: corejs is not a valid top-level option.
Maybe you meant to use 'targets'? (While processing: "/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js")
at validateTopLevelOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:49:13)
at normalizeOptions (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/normalize-options.js:160:3)
at _default (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/preset-env/lib/index.js:168:37)
at /Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/@babel/helper-plugin-utils/lib/index.js:19:12
at loadDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:165:14)
at cachedFunction (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/caching.js:33:19)
at loadPresetDescriptor (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:235:63)
at config.presets.reduce (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:77:21)
at Array.reduce (<anonymous>)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:74:38)
at recurseDescriptors (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:94:27)
at loadFullConfig (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/config/full.js:108:6)
at process.nextTick (/Users/carlosbeneto/Documents/JS/lonely-lentil-site/node_modules/gatsby/node_modules/@babel/core/lib/transform.js:28:33)
at process._tickCallback (internal/process/next_tick.js:61:11)
这是我的package.json:
Here's my package.json:
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.19",
"@fortawesome/free-solid-svg-icons": "^5.9.0",
"@fortawesome/react-fontawesome": "^0.1.4",
"bulma": "^0.7.5",
"core-js": "2",
"gatsby": "^2.13.31",
"gatsby-image": "^2.2.6",
"gatsby-plugin-google-analytics": "^2.1.4",
"gatsby-plugin-netlify": "^2.1.3",
"gatsby-plugin-netlify-cms": "^4.1.6",
"gatsby-plugin-netlify-cms-paths": "^1.2.2",
"gatsby-plugin-purgecss": "^3.1.1",
"gatsby-plugin-react-helmet": "^3.1.2",
"gatsby-plugin-sass": "^2.1.3",
"gatsby-plugin-sharp": "^2.2.8",
"gatsby-plugin-sitemap": "^2.2.3",
"gatsby-remark-copy-linked-files": "^2.1.3",
"gatsby-remark-images": "^3.1.6",
"gatsby-remark-relative-images": "^0.2.2",
"gatsby-source-filesystem": "^2.1.5",
"gatsby-transformer-remark": "^2.6.7",
"gatsby-transformer-sharp": "^2.2.4",
"lodash": "^4.17.15",
"lodash-webpack-plugin": "^0.11.4",
"netlify-cms-app": "^2.9.6",
"node-sass": "^4.12.0",
"parcel-bundler": "^1.12.3",
"prop-types": "^15.6.0",
"react": "^16.8.6",
"react-add-to-calendar": "^0.1.5",
"react-dom": "^16.8.6",
"react-facebook": "^7.0.6",
"react-helmet": "^5.2.1",
"react-image-gallery": "^0.8.18",
"react-share": "^2.4.0",
"uuid": "^3.2.1"
},
推荐答案
我不确定这是否对本地构建有所帮助,但是今天在Netlify上进行部署时遇到了同样的问题,并且已经能够解决该问题通过切换到npm.
I'm not sure if this can help for local builds, but I had the same issue when deploying on Netlify today and I have been able to solve the issue by switching to npm.
这是我遵循的步骤:
- 删除了
yarn.lock
而旧的package-lock.json
- 添加了
yarn.lock
,从.gitignore
中删除了 - 已删除
node_modules
文件夹 - 使用npm重新安装依赖项
- 使用npm运行构建命令
package-lock.json
- removed
yarn.lock
and oldpackage-lock.json
- added
yarn.lock
, removedpackage-lock.json
from.gitignore
- removed
node_modules
folder - re-installed dependencies with npm
- run build command with npm
这篇关于盖茨比(Gatsby)生产失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!