"name": "newapp",
"version": "1.0.0",
"description": "",
"main": "app.js",
"scripts": {
"start": "nodemon server.js",
"start-server": "nodemon server.js",
"start-client": "npm start --prefix my-app",
"dev": "concurrently \"npm run start-server\" \"npm run start-client\"",
"heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix my-app && npm run build
--prefix my-app"
当我想将heroku推送到这个现代应用程序时,我无法在react应用程序中构建文件,也无法使用
"heroku-postbuild":"cd my-app && npm install && npm run build "
错误是不同的:-
[enter image description here][1]"msg":"ENOENT: no such file or directory, stat '/app/my-app/build/index.html'"
这是我的文件夹列表的照片[1]:https://i.stack.imgur.com/0xGGT.png
heroku的日志 >建立 运行heroku-postbuild
> newapp@1.0.0 heroku-postbuild /tmp/build_a1510cbf93d0f6e7800b0118461ed11e
> npm install --prefix my-app && npm run build --prefix my-app
up to date in 0.489s
found 0 vulnerabilities
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path /tmp/build_a1510cbf93d0f6e7800b0118461ed11e/my-
app/package.json
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, open
'/tmp/build_a1510cbf93d0f6e7800b0118461ed11e/my-app/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /tmp/npmcache.DC8r1/_logs/2020-06-29T08_36_42_692Z-debug.log
npm ERR! code ELIFECYCLE
npm ERR! errno 254
npm ERR! newapp@1.0.0 heroku-postbuild: ` npm install --prefix my-app &&
npm run build --prefix my-app`
npm ERR! Exit status 254
npm ERR!
npm ERR! Failed at the newapp@1.0.0 heroku-postbuild script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR!可以在以下位置找到此运行的完整日志: npm ERR! /tmp/npmcache.DC8r1/_logs/2020-06-29T08_36_42_707Z-debug.log ----->构建失败
We're sorry this build is failing! You can troubleshoot common issues here:
https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Some possible problems:
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-
js-version
Love,
Heroku
!推送被拒绝,无法编译Node.js应用。 !推送失败