简体   繁体   English

为什么 heroku 无法在项目上编译构建?

[英]why does heroku fail to compile build on project?

I'm trying to deploy a react app I worked on and when I try to push to heroku master it says "failed to compile node.js".我正在尝试部署我工作过的 React 应用程序,当我尝试推送到 heroku 主服务器时,它显示“无法编译 node.js”。 Now I've already tried to specify what node I'm using by following the steps, but still getting an error.现在我已经尝试按照步骤指定我正在使用的节点,但仍然出现错误。

Here is what I'm getting in the terminal:这是我在终端中得到的:

Creating an optimized production build... remote: Failed to compile.创建优化的生产版本...远程:编译失败。 remote:偏僻的:
remote: ./src/pages/Home/Home.js remote: Cannot find file '../../Components/Intro' in './src/pages/Home'.远程:./src/pages/Home/Home.js 远程:在“./src/pages/Home”中找不到文件“../../Components/Intro”。 remote:偏僻的:
remote:偏僻的:
remote: npm ERR: code ELIFECYCLE remote: npm ERR.远程:npm ERR:代码 ELIFECYCLE 远程:npm ERR。 errno 1 remote. errno 1 遥控器。 npm ERR: client@0.1.0 build: react-scripts build remote: npm ERR: Exit status 1 remote: npm ERR. npm ERR:client@0.1.0 build: react-scripts build remote:npm ERR:退出状态1远程:npm ERR。 remote.偏僻的。 npm ERR. npm 错误。 Failed at the client@0:1.0 build script.在 client@0:1.0 构建脚本中失败。 remote: npm ERR: This is probably not a problem with npm: There is likely additional logging output above: remote.远程:npm ERR:这可能不是 npm 的问题:上面可能有额外的日志记录 output:远程。 remote.偏僻的。 npm ERR: A complete log of this run can be found in: remote: npm ERR. npm ERR:此运行的完整日志可在以下位置找到:远程:npm ERR。 /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_080Z-debug:log remote: npm ERR! /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_080Z-debug:日志远程:npm ERR! code ELIFECYCLE remote: npm ERR!代码 ELIFECYCLE 遥控器:npm 错误! errno 1 remote: npm ERR!错误号 1 遥控器:npm 错误! kyndco-app@1.0.0 build: cd client && npm run build remote: npm ERR: Exit status 1 remote: npm ERR. kyndco-app@1.0.0 构建: cd client && npm run build远程:npm ERR:退出状态 1 远程:npm ERR。 remote.偏僻的。 npm ERR. npm 错误。 Failed at the kyndco-app@1:0.0 build script. kyndco-app@1:0.0 构建脚本失败。 remote: npm ERR: This is probably not a problem with npm: There is likely additional logging output above: remote.远程:npm ERR:这可能不是 npm 的问题:上面可能有额外的日志记录 output:远程。 remote.偏僻的。 npm ERR: A complete log of this run can be found in: remote: npm ERR. npm ERR:此运行的完整日志可在以下位置找到:远程:npm ERR。 /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_461Z-debug:log remote: npm ERR! /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_461Z-debug:日志远程:npm ERR! code ELIFECYCLE remote: npm ERR!代码 ELIFECYCLE 遥控器:npm 错误! errno 1 remote: npm ERR!错误号 1 遥控器:npm 错误! kyndco-app@1.0.0 heroku-postbuild: npm run build remote: npm ERR: Exit status 1 remote: npm ERR. kyndco-app@1.0.0 heroku-postbuild: npm run build远程:npm ERR:退出状态1远程:npm ERR。 remote.偏僻的。 npm ERR. npm 错误。 Failed at the kyndco-app@1:0.0 heroku-postbuild script.在 kyndco-app@1:0.0 heroku-postbuild 脚本中失败。 remote: npm ERR: This is probably not a problem with npm: There is likely additional logging output above: remote.远程:npm ERR:这可能不是 npm 的问题:上面可能有额外的日志记录 output:远程。 remote.偏僻的。 npm ERR: A complete log of this run can be found in: remote: npm ERR! npm ERR:此运行的完整日志可在以下位置找到:远程:npm ERR! /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_568Z-debug.log remote: remote: -----> Build failed remote: /tmp/npmcache.g54nm/_logs/2020-05-21T03_01_57_568Z-debug.log 远程:远程:-----> 构建失败远程:
remote: We're sorry this build is failing: You can troubleshoot common issues here: remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys远程:很抱歉,此构建失败:您可以在此处解决常见问题:远程: https://devcenter.heroku.com/articles/troubleshooting-node-deploys

It might have to do with.gitignore file.它可能与 .gitignore 文件有关。 Make sure /Componentes/Intro is not added in.gitignore file确保 /Componentes/Intro 没有添加到 .gitignore 文件中

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM