gpt4 book ai didi

npm - 'gatsby build' 在 Travis CI 中失败 - 错误 #98123 WEBPACK

转载 作者:行者123 更新时间:2023-12-04 13:40:56 28 4
gpt4 key购买 nike

我正在尝试使用 AWS S3、CloudFront、CodePipeline 和 Travis CI 部署我的投资组合网站。
一切正常,但 Travis CI 构建一直失败。
gatsby build给我一个错误:
error #98123 WEBPACKGenerating JavaScript bundles failed
This question与我的非常相似,但解决方案与我的无关,因为我没有 yarn 文件,我尝试重新安装我的 npm 依赖项。

这是我的日志副本:


Generating JavaScript bundles failed

Can't resolve '../components/Layout' in '/home/travis/build/stomg7969/react-portfolio/src/pages'

File: src/pages/index.js

See our docs page for more info on this error: https://gatsby.dev/issue-how-to

error #98123 WEBPACK

Generating JavaScript bundles failed

Can't resolve '../components/Layout' in '/home/travis/build/stomg7969/react-portfolio/src/pages'

File: src/pages/404.js

See our docs page for more info on this error: https://gatsby.dev/issue-how-to

The command "gatsby clean && gatsby build" exited with 1.

store build cache

Done. Your build exited with 1.

这是我的 package.json .
  "name": "gatsby-starter-spectral",
"version": "0.0.1",
"description": "Gatsby.js V2 starter template based on Spectral by HTML5 UP",
"repository": {
"type": "git",
"url": "git+https://github.com/anubhavsrivastava/gatsby-starter-spectral.git"
},
"author": {
"name": "Anubhav Srivastava",
"email": "anubhav.srivastava00@gmail.com"
},
"dependencies": {
"gatsby": "^2.13.39",
"gatsby-plugin-manifest": "^2.2.3",
"gatsby-plugin-offline": "^2.1.0",
"gatsby-plugin-react-helmet": "^3.0.12",
"gatsby-plugin-sass": "^2.0.11",
"node-sass": "^4.12.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-helmet": "^5.2.1",
"react-images": "1.0.0",
"react-scrollspy": "^3.4.0",
"smoothscroll-polyfill": "^0.4.4"
},
"scripts": {
"develop": "gatsby develop",
"build": "npm run clean && gatsby build",
"deploy": "npm run clean && gatsby build --prefix-paths && gh-pages -d public",
"serve": "gatsby serve",
"clean": "rimraf .cache public",
"format": "prettier --write '**/*.js'",
"test": "echo \"Error: no test specified\" && exit 1"
},
"devDependencies": {
"gh-pages": "^2.0.1",
"prettier": "^1.17.0",
"rimraf": "^2.6.3"
},
"keywords": [
"gatsby",
"gatsby-starter",
"gatsby-starter-spectral"
],
"license": "MIT",
"bugs": {
"url": "https://github.com/anubhavsrivastava/gatsby-starter-spectral/issues"
},
"homepage": "https://github.com/anubhavsrivastava/gatsby-starter-spectral#readme"
}

最后,这是我的 .travis.yml文件。
language: node_js
node_js:
- 11.8.0
install: npm install
script: gatsby clean && gatsby build
deploy:
provider: s3
access_key_id: $AWS_KEY
secret_access_key: $AWS_SECRET
bucket: 'thedevelopark.com'
skip_cleanup: true
acl: public_read
local_dir: public

提前感谢您的反馈。

最佳答案

我遇到了同样的问题,并尝试并检查了区分大小写一千次。不会做任何事情。

然后我更改了组件的名称 在所有领域,文件名,导入,导出,你的名字。现在它起作用了。

我不知道 Netlify 是否对我的组件名称“Socials”有问题?猜猜我永远不会发现。

关于npm - 'gatsby build' 在 Travis CI 中失败 - 错误 #98123 WEBPACK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57189244/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com