NodeJS アプリを Heroku サーバーにデプロイすると、このエラーが発生します。
2019-08-27T05:54:03.597197+00:00 heroku[web.1]: State changed from starting to crashed
2019-08-27T05:54:03.569746+00:00 heroku[web.1]: Process exited with status 1
2019-08-27T05:59:55.107447+00:00 heroku[web.1]: State changed from crashed to starting
2019-08-27T05:59:58.079934+00:00 heroku[web.1]: Starting process with command `npm start`
2019-08-27T06:00:00.687008+00:00 heroku[web.1]: State changed from starting to crashed
2019-08-27T06:00:00.660988+00:00 heroku[web.1]: Process exited with status 1
2019-08-27T06:00:00.452248+00:00 app[web.1]: > realtime-chat@1.0.0 start /app
2019-08-27T06:00:00.452250+00:00 app[web.1]: > node index.js
2019-08-27T06:00:00.452252+00:00 app[web.1]:
2019-08-27T06:00:00.574510+00:00 app[web.1]: /app/index.js:1
2019-08-27T06:00:00.574514+00:00 app[web.1]: import express from "express";
2019-08-27T06:00:00.574517+00:00 app[web.1]: ^^^^^^^
2019-08-27T06:00:00.574519+00:00 app[web.1]:
2019-08-27T06:00:00.581327+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2019-08-27T06:00:00.581759+00:00 app[web.1]: npm ERR! errno 1
2019-08-27T06:00:00.582977+00:00 app[web.1]: npm ERR! realtime-chat@1.0.0 start: `node index.js`
2019-08-27T06:00:00.583139+00:00 app[web.1]: npm ERR! Exit status 1
2019-08-27T06:00:00.583436+00:00 app[web.1]: npm ERR!
2019-08-27T06:00:00.583640+00:00 app[web.1]: npm ERR! Failed at the realtime-chat@1.0.0 start script.
2019-08-27T06:00:00.583830+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2019-08-27T06:00:00.593702+00:00 app[web.1]:
私の構成: package.json ファイル。
{
"name": "realtime-chat",
"version": "1.0.0",
"description": "sjc-realtimechat",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "babel-node index.js",
"postinstall": "bower cache clean && bower install"
},
"keywords": [
"sjc"
],
"author": "sjc-bui",
"license": "ISC",
"dependencies": {
"babel-cli": "^6.26.0",
"babel-preset-env": "^1.7.0",
"bcrypt": "^3.0.6",
"bluebird": "^3.5.5",
"body-parser": "^1.19.0",
"bower": "^1.8.8",
"connect-mongo": "^3.0.0",
"cookie-parser": "^1.4.4",
"dotenv": "^8.0.0",
"ejs": "^2.6.2",
"emojione": "^4.5.0",
"express": "^4.17.1",
"express-flash": "0.0.2",
"express-session": "^1.16.2",
"express-validator": "^6.1.1",
"fs-extra": "^7.0.1",
"google-translate": "^2.2.0",
"http": "0.0.0",
"https": "^1.0.0",
"lodash": "^4.17.11",
"moment": "^2.24.0",
"mongoose": "^5.6.4",
"multer": "^1.4.1",
"nodemailer": "^4.4.2",
"passport": "^0.4.0",
"passport-google-oauth": "^2.0.0",
"passport-local": "^1.0.0",
"passport.socketio": "^3.7.0",
"request": "^2.88.0",
"socket.io": "^2.2.0",
"uuid": "^3.3.2"
},
"devDependencies": {}
}
私の設定:Profileファイル
web: npm start
サーバーでbabel-node index.jsを実行しようとしています。しかし、このエラーが発生しました
npm ERR! realtime-chat@1.0.0 start: node index.js
私はそれを修正するために探していましたが、それでもこのエラーが発生しました。助けてください。
アップデート
依存関係は既にインストールされていますが、「npm start」エラーが発生します。