找不到文件?"/>
为什么heroku无法使我的构建失败,并说它在本地工作时找不到文件?
这里是按下heroku时发生的事情:
remote: -----> Build
remote: Running build
remote:
remote: > [email protected] build /tmp/build_960f0e66a47347274538f4490dbb400d
remote: > react-scripts build
remote:
remote: Creating an optimized production build...
remote: Failed to compile.
remote:
remote: ./src/App.js
remote: Cannot find file './pages/About' in './src'.
remote:
remote:
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! [email protected] build: `react-scripts build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the [email protected] build script.
remote: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
remote:
remote: npm ERR! A complete log of this run can be found in:
remote: npm ERR! /tmp/npmcache.7v0ee/_logs/2020-05-12T22_42_31_150Z-debug.log
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 boiling-island-73749.
remote:
To .git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to '.git'
它表示该构建失败,因为它找不到About.js。但是,我一直在本地打开我的应用程序,About.js表现得很好。我看不出为什么找不到该文件并导致构建失败。我还从heroku收到不同的消息,它要么无法指定节点版本,要么说“ engines.node中的危险semver范围(>)”。目前,我的package.json表示:
"engines": {
"node": "12.14.x",
"npm": "6.x"
}
有人知道我的构建为什么会不断失败并且拒绝推送到Heroku吗?
回答如下:更多推荐
为什么heroku无法使我的构建失败,并说它在本地工作时找不到文件?
发布评论