У меня есть приложение с реагирующим интерфейсом и python flask бэкэнд. Я пытаюсь развернуть свой проект на heroku. Я следовал этому руководству . Но я продолжаю получать эту ошибку, когда пытаюсь выполнить sh свой проект для освоения:
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
engines.node (package.json): unspecified
engines.npm (package.json): unspecified (use default)
Resolving node version 12.x...
Downloading and installing node 12.18.2...
Using default npm version: 6.14.5
-----> Installing dependencies
Prebuild detected (node_modules already exists)
Rebuilding any native modules
npm ERR! code ENOENT
npm ERR! syscall chmod
npm ERR! path /tmp/build_0912bba7c20dc3b2b0f5ffd13fe70109/node_modules/semver/bin/semver.js
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, chmod '/tmp/build_0912bba7c20dc3b2b0f5ffd13fe70109/node_modules/semver/bin/semver.js'
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.WnwYf/_logs/2020-07-14T16_30_34_532Z-debug.log
-----> Build failed
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_modules checked into source control
https://blog.heroku.com/node-habits-2016#9-only-git-the-important-bits
- Node version not specified in package.json
https://devcenter.heroku.com/articles/nodejs-support#specifying-a-node-js-version
Love,
Heroku
! Push rejected, failed to compile Node.js app.
! Push failed
Я пробовал эти 2 рекомендации, но ничего не изменилось.
Просто для информации, .gitignore
выглядит так:
# dependencies
/node_modules
/.pnp
.pnp.js
env
# testing
/coverage
# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local
__pycache__
node_modules
npm-debug.log*
yarn-debug.log*
yarn-error.log*
и package.json
выглядит так:
{
"name": "app",
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.10.0",
"@material-ui/icons": "^4.9.1",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
"material-design-icons": "^3.0.1",
"node-sass": "^4.14.1",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
"react-stopwatch": "^2.0.4",
"symbols": "0.0.6"
},
"scripts": {
"start": "react-scripts start",
"start-api": "cd api && python app.py",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"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"
]
},
"proxy": "http://localhost:5000",
"engines": {
"node": "14.x",
"npm": "6.x"
}
}
Спасибо за любую помощь!