找不到所需的文件 index.js,在 /tmp/build

编程入门 行业动态 更新时间:2024-10-03 17:20:30

<a href=https://www.elefans.com/category/jswz/34/1771416.html style=找不到所需的文件 index.js,在 /tmp/build"/>

找不到所需的文件 index.js,在 /tmp/build

我试图将我最近的代码推送到 Heroku。这是我在控制台中得到的:

Enumerating objects: 39, done.
Counting objects: 100% (39/39), done.
Delta compression using up to 8 threads
Compressing objects: 100% (26/26), done.
Writing objects: 100% (32/32), 2.90 KiB | 593.00 KiB/s, done.
Total 32 (delta 12), reused 0 (delta 0), pack-reused 0
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Building on the Heroku-20 stack
remote: -----> Using buildpack: heroku/nodejs
remote: -----> Node.js app detected
remote:        
remote: -----> Creating runtime environment
remote:
remote:        NPM_CONFIG_LOGLEVEL=error
remote:        NODE_VERBOSE=false
remote:        NODE_ENV=production
remote:        NODE_MODULES_CACHE=true
remote:
remote: -----> Installing binaries
remote:        engines.node (package.json):  16.14.0
remote:        engines.npm (package.json):   8.3.1
remote:
remote:        Resolving node version 16.14.0...
remote:        Downloading and installing node 16.14.0...
remote:        npm 8.3.1 already installed with node
remote:        
remote: -----> Restoring cache
remote:        Cached directories were not restored due to a change in version of node, npm, yarn or stack
remote:        Module installation may take longer for this build
remote:        
remote: -----> Installing dependencies
remote:        Installing node modules
remote:        
remote:        added 1403 packages, and audited 1404 packages in 28s
remote:
remote:        175 packages are looking for funding
remote:          run `npm fund` for details
remote:
remote:        8 vulnerabilities (6 moderate, 2 high)
remote:
remote:        To address issues that do not require attention, run:
remote:          npm audit fix
remote:
remote:        To address all issues (including breaking changes), run:
remote:          npm audit fix --force
remote:
remote:        Run `npm audit` for details.
remote:        
remote: -----> Build
remote:        Running build
remote:        
remote:        > [email protected] build
remote:        > react-scripts build
remote:
remote:        Could not find a required file.
remote:          Name: index.js
remote:          Searched in: /tmp/build_1ff4f4ff/src
remote: 
remote: -----> Build failed
remote:        
remote:        We're sorry this build is failing! You can troubleshoot common issues here:
remote:        
remote:
remote:        If you're stuck, please submit a ticket so we can help:
remote:        /
remote:
remote:        Love,
remote:        Heroku
remote:
remote:  !     Push rejected, failed to compile Node.js app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !       Push rejected to chatapp-project-kasper.
remote:
To .git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '.git'

它似乎正在某处搜索文件。这是我的文件夹结构:

我不确定这个文件在哪里,或者我如何更改 heroku 搜索文件的位置。另外,在我的 Procfile 中我有这个:

web: node src/App.js

任何帮助将不胜感激。

回答如下:

你好,你解决了吗我遇到了同样的问题

问候

更多推荐

找不到所需的文件 index.js,在 /tmp/build

本文发布于:2024-05-30 11:27:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1770449.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:找不到   所需   文件   index   tmp

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!