У меня проблема с отправкой кодов в Heroku. package. json
{
"name": "my-app",
"version": "0.1.0",
"engine": {
"node": "12.16.2",
"npm": "6.13.4"
},
"private": true,
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"bcrypt": "^4.0.1",
"body-parser": "^1.18.3",
"cookie-parser": "^1.4.3",
"express": "^4.17.1",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.4.20",
"nodemon": "^2.0.2",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-scripts": "3.4.1"
},
"scripts": {
"start": "node server/index.js",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject",
"backend": "nodemon server/index.js"
},
"eslintConfig": {
"extends": "react-app"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}
output
remote: engines.node (package.json): unspecified
remote: engines.npm (package.json): unspecified (use default)
remote:
remote: Resolving node version 12.x...
remote: Downloading and installing node 12.16.1...
remote: Using default npm version: 6.13.4
<!-- more stuff -->
remote: -----> Build
remote: Running build
remote:
remote: > my-app@0.1.0 build /tmp/build_016788c07037e47ee5638bf5c1b1f631
remote: > react-scripts build
remote:
remote: Could not find a required file.
remote: Name: index.html
remote: Searched in: /tmp/build_016788c07037e47ee5638bf5c1b1f631/public
remote: npm ERR! code ELIFECYCLE
remote: npm ERR! errno 1
remote: npm ERR! my-app@0.1.0 build: `react-scripts build`
remote: npm ERR! Exit status 1
remote: npm ERR!
remote: npm ERR! Failed at the my-app@0.1.0 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.yXjxR/_logs/2020-04-11T07_16_57_245Z-debug.log
remote:
remote: -----> Build failed
remote:
remote: We're sorry this build is failing! You can troubleshoot common issues here:
remote: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
remote:
remote: Some possible problems:
remote:
remote: - Node version not specified in package.json
remote: https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
remote:
remote: Love,
remote: Heroku
remote:
remote: ! Push rejected, failed to compile Node.js app.
remote:
remote: ! Push failed
Как вы можете видеть, хотя я указал свой узел и npm версию в package.json
Heroku не распознает его, а мой pu sh отклонено. Я пытался сделать билет на веб-сайте Heroku, но так как это бесплатное приложение, они не позволили мне попросить их по телефону доверия.
редактировать Heroku обновил npm и версию узла до версии по умолчанию, но я получаю сообщение об ошибке Could not find a required file.Name: index.html