У меня есть приложение узла, отлично работающее на локальном хосте. но после развертывания в Heroku происходит сбой.
Вот журнал ошибок:
2019-11-07T10:58:20.359983+00:00 heroku[web.1]: Starting process with
command `npm start`
2019-11-07T10:58:22.882837+00:00 heroku[web.1]: State changed from starting to crashed
2019-11-07T10:58:22.866125+00:00 heroku[web.1]: Process exited with status 1
2019-11-07T10:58:22.768738+00:00 app[web.1]:
2019-11-07T10:58:22.768765+00:00 app[web.1]: > dpapi@1.0.0 start /app
2019-11-07T10:58:22.768768+00:00 app[web.1]: > nodemon --exec babel-node server.js --plugins css-modules-transform --ignore dist/
2019-11-07T10:58:22.768770+00:00 app[web.1]:
2019-11-07T10:58:22.783839+00:00 app[web.1]: sh: 1: nodemon: not found
2019-11-07T10:58:22.788270+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-11-07T10:58:22.788822+00:00 app[web.1]: npm ERR! syscall spawn
2019-11-07T10:58:22.789278+00:00 app[web.1]: npm ERR! file sh
2019-11-07T10:58:22.789688+00:00 app[web.1]: npm ERR! errno ENOENT
2019-11-07T10:58:22.791368+00:00 app[web.1]: npm ERR! dpapi@1.0.0 start: `nodemon --exec babel-node server.js --plugins css-modules-transform --ignore dist/`
2019-11-07T10:58:22.791637+00:00 app[web.1]: npm ERR! spawn ENOENT
2019-11-07T10:58:22.791917+00:00 app[web.1]: npm ERR!
2019-11-07T10:58:22.792199+00:00 app[web.1]: npm ERR! Failed at the dpapi@1.0.0 start script.
2019-11-07T10:58:22.792534+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-11-07T10:58:22.802491+00:00 app[web.1]:
2019-11-07T10:58:22.802775+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-11-07T10:58:22.802918+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-11-07T10_58_22_793Z-debug.log
Я не уверен насчет причины, но похоже, что он не может найти nodemon, Возможно, он не можетустановить все зависимости. как упоминалось в сообщении об ошибке;
Вот мой Procfile:
web: npm start
, а вот мой package.json
{
"name": "dpapi",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "nodemon --exec babel-node server.js --plugins css-modules-transform --ignore dist/",
"dev": "webpack -wd"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {
"@babel/plugin-transform-runtime": "^7.4.4",
"babel-eslint": "^10.0.1",
"babel-preset-es2015": "^6.24.1",
"eslint": "^5.16.0",
"eslint-plugin-react": "^7.13.0",
"nodemon": "^1.18.11",
"webpack-cli": "^3.3.1"
},
"dependencies": {
"@babel/core": "^7.4.4",
"@babel/node": "^7.2.2",
"@babel/plugin-proposal-class-properties": "^7.4.4",
"@babel/plugin-proposal-export-default-from": "^7.2.0",
"@babel/preset-env": "^7.4.4",
"@babel/preset-react": "^7.0.0",
"@material-ui/core": "^4.0.0-rc.0",
"@material-ui/icons": "^3.0.2",
"axios": "^0.18.0",
"babel-loader": "^8.0.5",
"bcrypt": "^3.0.6",
"body-parser": "^1.19.0",
"buffer": "^5.2.1",
"dropbox": "^4.0.17",
"ejs": "^2.6.1",
"express": "^4.16.4",
"global": "^4.4.0",
"imagemagick": "^0.1.3",
"isomorphic-fetch": "^2.2.1",
"js-file-download": "^0.4.7",
"jsonwebtoken": "^8.5.1",
"mongoose": "^5.5.7",
"morgan": "^1.9.1",
"multer": "^1.4.1",
"node-fetch": "^2.5.0",
"nodemailer": "^6.2.1",
"query-string": "^6.5.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-redux": "^7.0.3",
"react-router-dom": "^5.0.0",
"react-stripe-elements": "^3.0.0",
"redux": "^4.0.1",
"redux-logger": "^3.0.6",
"rimraf": "^2.6.3",
"socket.io": "^2.2.0",
"socket.io-client": "^2.2.0",
"stripe": "^7.4.0",
"webpack": "^4.30.0"
}
}