Npm ';盖茨比大厦';Travis CI失败-错误#98123网页包
我正在尝试使用AWS S3、CloudFront、CodePipeline和Travis CI部署我的投资组合网站。 一切正常,但Travis CI构建一直失败Npm ';盖茨比大厦';Travis CI失败-错误#98123网页包,npm,yaml,travis-ci,gatsby,Npm,Yaml,Travis Ci,Gatsby,我正在尝试使用AWS S3、CloudFront、CodePipeline和Travis CI部署我的投资组合网站。 一切正常,但Travis CI构建一直失败 gatsby build给了我一个错误: error#98123网页 生成JavaScript捆绑包失败 与我的非常相似,但解决方案与我无关,因为我没有Thread文件,我尝试重新安装我的npm依赖项 这是我的日志副本: Generating JavaScript bundles failed Can't resolve '../c
gatsby build
给了我一个错误:
error#98123网页
生成JavaScript捆绑包失败
与我的非常相似,但解决方案与我无关,因为我没有Thread文件,我尝试重新安装我的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”有问题?我想我永远也找不到了。在本地,一切都正常吗?日志表明它找不到一个被404页和index页使用的“布局”文件。js谢谢您的回复。是的,在本地,“盖茨比构建”或“npm运行构建”工作正常,一点问题也没有。它只在我尝试在Travis CI或AWS CodeBuild上运行时给出错误(与我大约一周前尝试的错误相同)。***“布局”是每页页脚的组件。是我到repo的链接。在脚本之前添加
怎么样:
到您的.travis.yml
文件中,使用-“npm i-g gatsby cli”
你好,很遗憾,是的,我在上尝试了在脚本之前。travis.yml
。我遇到了一个类似的问题,它困扰了我的时间比我想承认的时间要长得多。我的问题最终与案件敏感性有关。我的mac文件系统不区分大小写,而Travis CI build运行在一个区分大小写的Linux实例上。我提交了一个大写文件名,然后在本地(不区分大小写)文件系统中将其更改为小写,但Travis CI实例总是签出大写版本。一旦我在git中修复了它,我的构建就开始按预期工作。