I'm new to heroku and when running my node.js app for the first time I get an application error. I have trouble discerning what exactly is the issue since the program runs fine locally. Here is the log. I can post the node.js code if need be, but specfically I know
http.listen(process.env.PORT || 3000, function(){
console.log('listening on *:3000');
});
should be right
2016-06-06T23:38:54.950995+00:00 heroku[api]: Release v2 created by 96benchu#gmail.com
2016-06-06T23:38:54.950923+00:00 heroku[api]: Enable Logplex by 96benchu#gmail.com
2016-06-06T23:39:20.282705+00:00 heroku[api]: Scale to web=1 by 96benchu#gmail.com
2016-06-06T23:39:20.283517+00:00 heroku[api]: Deploy 5244c81 by 96benchu#gmail.com
2016-06-06T23:39:20.283586+00:00 heroku[api]: Release v3 created by 96benchu#gmail.com
2016-06-06T23:39:20.707206+00:00 heroku[slug-compiler]: Slug compilation started
2016-06-06T23:39:20.707211+00:00 heroku[slug-compiler]: Slug compilation finished
2016-06-06T23:39:22.230869+00:00 heroku[web.1]: Starting process with command `npm start`
2016-06-06T23:39:24.373251+00:00 app[web.1]: npm ERR! Linux 3.13.0-85-generic
2016-06-06T23:39:24.373791+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-06-06T23:39:24.374028+00:00 app[web.1]: npm ERR! node v5.11.1
2016-06-06T23:39:24.374471+00:00 app[web.1]: npm ERR! npm v3.8.6
2016-06-06T23:39:24.375629+00:00 app[web.1]:
2016-06-06T23:39:24.376442+00:00 app[web.1]: npm ERR! missing script: start
2016-06-06T23:39:24.376571+00:00 app[web.1]: npm ERR!
2016-06-06T23:39:24.376669+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-06-06T23:39:24.376763+00:00 app[web.1]: npm ERR! <https://github.com/npm/npm/issues>
2016-06-06T23:39:24.384251+00:00 app[web.1]:
2016-06-06T23:39:24.384417+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-06-06T23:39:24.384520+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-06-06T23:39:25.117419+00:00 heroku[web.1]: State changed from starting to crashed
2016-06-06T23:39:25.118722+00:00 heroku[web.1]: State changed from crashed to starting
2016-06-06T23:39:25.105763+00:00 heroku[web.1]: Process exited with status 1
2016-06-06T23:39:26.845316+00:00 heroku[web.1]: Starting process with command `npm start`
2016-06-06T23:39:30.360228+00:00 app[web.1]: npm ERR! Linux 3.13.0-85-generic
2016-06-06T23:39:30.360970+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-06-06T23:39:30.361314+00:00 app[web.1]: npm ERR! node v5.11.1
2016-06-06T23:39:30.362144+00:00 app[web.1]: npm ERR! npm v3.8.6
2016-06-06T23:39:30.364140+00:00 app[web.1]:
2016-06-06T23:39:30.365320+00:00 app[web.1]: npm ERR! missing script: start
2016-06-06T23:39:30.365478+00:00 app[web.1]: npm ERR!
2016-06-06T23:39:30.365600+00:00 app[web.1]: npm ERR! If you need help, you may report this error at:
2016-06-06T23:39:30.365735+00:00 app[web.1]: npm ERR! <https://github.com/npm/npm/issues>
2016-06-06T23:39:30.381812+00:00 app[web.1]:
2016-06-06T23:39:30.382074+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-06-06T23:39:30.382233+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-06-06T23:39:31.427206+00:00 heroku[web.1]: State changed from starting to crashed
2016-06-06T23:39:31.409170+00:00 heroku[web.1]: Process exited with status 1
2016-06-06T23:40:10.611044+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-eyrie-35026.herokuapp.com request_id=9e530180-b522-4412-a321-54b90430b82f fwd="172.6.205.107" dyno= connect= service= status=503 bytes=
2016-06-06T23:40:11.404313+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=secret-eyrie-35026.herokuapp.com request_id=f039df37-b206-41df-80b8-5076330ae67f fwd="172.6.205.107" dyno= connect= service= status=503 bytes=
2016-06-06T23:41:02.960874+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=secret-eyrie-35026.herokuapp.com request_id=0ad763f1-7a6f-4324-b9ad-f81891d4ccba fwd="172.6.205.107" dyno= connect= service= status=503 bytes=
2016-06-06T23:41:03.729436+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=secret-eyrie-35026.herokuapp.com request_id=790a0e38-360c-447d-80a6-fa57914faf15 fwd="172.6.205.107" dyno= connect= service= status=503 bytes=
You can add start script in your package.json like following:
"scripts": {
"start": "node index.js"
},
so that your package.json will look like following:
{
"name": "socket-chat-example",
"version": "0.0.1",
"description": "my first socket.io app",
"scripts": {
"start": "node index.js"
},
"dependencies": { "express": "~4.10.2", "socket.io": "1.2.0", }
}
Related
i pushed my mern stack project to heroku master for deployement after opening the app its showing not found. spent so many hours and refered related stackoverflow questions nothing fixed my issue
i build my project using
"scripts": {
"build": "cd backend && npm install && cd ../frontend && npm install && npm run build",
"start": "node backend/server.js",
}
inside terminal i build my project using npm run build build successfully
server.js
app.use(express.static(path.join(__dirname, '/frontend/build')));
app.get('*', (req,res) => {
res.sendFile(path.join(__dirname, '/frontend/build/index.html'))
})
and here is my folder structure
files inside build folder
pushing files to heroku master return successfull with no errors.
loging heroku logs --tail gives this below
2022-11-08T06:05:01.882420+00:00 heroku[web.1]: State changed from crashed to starting
2022-11-08T06:05:09.142138+00:00 heroku[web.1]: Starting process with command `npm start`
2022-11-08T06:05:11.262904+00:00 app[web.1]:
2022-11-08T06:05:11.262931+00:00 app[web.1]: > blog-app#1.0.0 start
2022-11-08T06:05:11.262932+00:00 app[web.1]: > node backend/server.js
2022-11-08T06:05:11.262932+00:00 app[web.1]:
2022-11-08T06:05:11.880253+00:00 app[web.1]: server connected on port http://localhost:52809
2022-11-08T06:05:12.097847+00:00 heroku[web.1]: State changed from starting to up
2022-11-08T06:05:13.711620+00:00 app[web.1]: server connected to mongoDB
2022-11-08T06:05:23.749281+00:00 heroku[router]: at=info method=GET path="/" host=thekrishblog.herokuapp.com request_id=f8b42c26-5f03-46e5-a04e-0fa6cb14d8b8 fwd="117.204.133.112" dyno=web.1 connect=0ms service=7ms status=404 bytes=380 protocol=https
2022-11-08T06:05:23.750032+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/backend/frontend/build/index.html'
2022-11-08T06:06:26.010343+00:00 heroku[router]: at=info method=GET path="/" host=thekrishblog.herokuapp.com request_id=18800012-c573-49aa-a6f8-b107f95a3013 fwd="117.204.133.112" dyno=web.1 connect=0ms service=2ms status=404 bytes=380 protocol=https
2022-11-08T06:06:26.008479+00:00 app[web.1]: Error: ENOENT: no such file or directory, stat '/app/backend/frontend/build/index.html'
also refered Heroku ENOENT: no such file or directory, stat '/app/build/index.html' but it dosent answered my problem
I have created an app that upload some files and than send me object like that
{"name":"MEHMET SAYIN CV - 10_2021.pdf","type":"application/pdf","size":99771}
I used multer to handle uploading files. When I upload it to heroku I failed.I want to share the logs related.
2021-10-15T15:51:02.457409+00:00 app[api]: Deploy 6e984f86 by user sayinmehmet47#gmail.com
2021-10-15T15:51:02.457409+00:00 app[api]: Release v11 created by user sayinmehmet47#gmail.com
2021-10-15T15:51:03.599539+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-15T15:51:05.000000+00:00 app[api]: Build succeeded
2021-10-15T15:51:05.698098+00:00 heroku[web.1]: Starting process with command `npm start`
2021-10-15T15:51:06.737506+00:00 app[web.1]:
2021-10-15T15:51:06.737526+00:00 app[web.1]: > file_metadata#0.0.1 start /app
2021-10-15T15:51:06.737527+00:00 app[web.1]: > node server.js
2021-10-15T15:51:06.737527+00:00 app[web.1]:
2021-10-15T15:51:07.036041+00:00 app[web.1]: connected
2021-10-15T15:51:07.068246+00:00 app[web.1]: /app/node_modules/mkdirp/index.js:91
2021-10-15T15:51:07.068247+00:00 app[web.1]: throw err0;
2021-10-15T15:51:07.068248+00:00 app[web.1]: ^
2021-10-15T15:51:07.068248+00:00 app[web.1]:
2021-10-15T15:51:07.068248+00:00 app[web.1]: Error: EROFS: read-only file system, mkdir '/public'
2021-10-15T15:51:07.068249+00:00 app[web.1]: at Object.mkdirSync (fs.js:1013:3)
2021-10-15T15:51:07.068249+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:72:13)
2021-10-15T15:51:07.068250+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T15:51:07.068250+00:00 app[web.1]: at Function.sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T15:51:07.068250+00:00 app[web.1]: at new DiskStorage (/app/node_modules/multer/storage/disk.js:21:12)
2021-10-15T15:51:07.068251+00:00 app[web.1]: at module.exports (/app/node_modules/multer/storage/disk.js:65:10)
2021-10-15T15:51:07.068251+00:00 app[web.1]: at new Multer (/app/node_modules/multer/index.js:15:20)
2021-10-15T15:51:07.068252+00:00 app[web.1]: at multer (/app/node_modules/multer/index.js:95:12)
2021-10-15T15:51:07.068252+00:00 app[web.1]: at Object.<anonymous> (/app/api/files.js:4:16)
2021-10-15T15:51:07.068252+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14) {
2021-10-15T15:51:07.068253+00:00 app[web.1]: errno: -30,
2021-10-15T15:51:07.068253+00:00 app[web.1]: syscall: 'mkdir',
2021-10-15T15:51:07.068253+00:00 app[web.1]: code: 'EROFS',
2021-10-15T15:51:07.068254+00:00 app[web.1]: path: '/public'
2021-10-15T15:51:07.068254+00:00 app[web.1]: }
2021-10-15T15:51:07.079497+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2021-10-15T15:51:07.079732+00:00 app[web.1]: npm ERR! errno 1
2021-10-15T15:51:07.083831+00:00 app[web.1]: npm ERR! file_metadata#0.0.1 start: `node server.js`
2021-10-15T15:51:07.083871+00:00 app[web.1]: npm ERR! Exit status 1
2021-10-15T15:51:07.083924+00:00 app[web.1]: npm ERR!
2021-10-15T15:51:07.083988+00:00 app[web.1]: npm ERR! Failed at the file_metadata#0.0.1 start script.
2021-10-15T15:51:07.083989+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-15T15:51:07.089384+00:00 app[web.1]:
2021-10-15T15:51:07.089446+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2021-10-15T15:51:07.089472+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2021-10-15T15_51_07_084Z-debug.log
2021-10-15T15:51:07.196350+00:00 heroku[web.1]: Process exited with status 1
2021-10-15T15:51:07.347289+00:00 heroku[web.1]: State changed from starting to crashed
2021-10-15T15:51:12.784398+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=filedownl12.herokuapp.com request_id=fe098106-1546-4b7c-9b8c-fefe790dfae7 fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T15:51:13.747221+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=filedownl12.herokuapp.com request_id=8173d073-97c1-45e1-afab-c3b2da397e12 fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T16:04:45.000000+00:00 app[api]: Build started by user sayinmehmet47#gmail.com
2021-10-15T16:05:21.465576+00:00 app[api]: Deploy 1f51e389 by user sayinmehmet47#gmail.com
2021-10-15T16:05:21.465576+00:00 app[api]: Release v12 created by user sayinmehmet47#gmail.com
2021-10-15T16:05:23.278268+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-15T16:05:24.000000+00:00 app[api]: Build succeeded
2021-10-15T16:05:26.141343+00:00 heroku[web.1]: Starting process with command `node ./server.js`
2021-10-15T16:05:27.754473+00:00 app[web.1]: connected
2021-10-15T16:05:27.819924+00:00 app[web.1]: /app/node_modules/mkdirp/index.js:91
2021-10-15T16:05:27.819926+00:00 app[web.1]: throw err0;
2021-10-15T16:05:27.819926+00:00 app[web.1]: ^
2021-10-15T16:05:27.819927+00:00 app[web.1]:
2021-10-15T16:05:27.819927+00:00 app[web.1]: Error: EROFS: read-only file system, mkdir '/public'
2021-10-15T16:05:27.819928+00:00 app[web.1]: at Object.mkdirSync (fs.js:1013:3)
2021-10-15T16:05:27.819928+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:72:13)
2021-10-15T16:05:27.819928+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T16:05:27.819929+00:00 app[web.1]: at Function.sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T16:05:27.819929+00:00 app[web.1]: at new DiskStorage (/app/node_modules/multer/storage/disk.js:21:12)
2021-10-15T16:05:27.819930+00:00 app[web.1]: at module.exports (/app/node_modules/multer/storage/disk.js:65:10)
2021-10-15T16:05:27.819930+00:00 app[web.1]: at new Multer (/app/node_modules/multer/index.js:15:20)
2021-10-15T16:05:27.819931+00:00 app[web.1]: at multer (/app/node_modules/multer/index.js:95:12)
2021-10-15T16:05:27.819931+00:00 app[web.1]: at Object.<anonymous> (/app/api/files.js:4:16)
2021-10-15T16:05:27.819931+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14) {
2021-10-15T16:05:27.819932+00:00 app[web.1]: errno: -30,
2021-10-15T16:05:27.819932+00:00 app[web.1]: syscall: 'mkdir',
2021-10-15T16:05:27.819932+00:00 app[web.1]: code: 'EROFS',
2021-10-15T16:05:27.819933+00:00 app[web.1]: path: '/public'
2021-10-15T16:05:27.819933+00:00 app[web.1]: }
2021-10-15T16:05:27.968565+00:00 heroku[web.1]: Process exited with status 1
2021-10-15T16:05:28.098649+00:00 heroku[web.1]: State changed from starting to crashed
2021-10-15T16:05:28.136896+00:00 heroku[web.1]: State changed from crashed to starting
2021-10-15T16:05:30.375434+00:00 heroku[web.1]: Starting process with command `node ./server.js`
2021-10-15T16:05:32.063799+00:00 app[web.1]: connected
2021-10-15T16:05:32.108031+00:00 app[web.1]: /app/node_modules/mkdirp/index.js:91
2021-10-15T16:05:32.108033+00:00 app[web.1]: throw err0;
2021-10-15T16:05:32.108033+00:00 app[web.1]: ^
2021-10-15T16:05:32.108033+00:00 app[web.1]:
2021-10-15T16:05:32.108034+00:00 app[web.1]: Error: EROFS: read-only file system, mkdir '/public'
2021-10-15T16:05:32.108034+00:00 app[web.1]: at Object.mkdirSync (fs.js:1013:3)
2021-10-15T16:05:32.108035+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:72:13)
2021-10-15T16:05:32.108035+00:00 app[web.1]: at sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T16:05:32.108035+00:00 app[web.1]: at Function.sync (/app/node_modules/mkdirp/index.js:78:24)
2021-10-15T16:05:32.108036+00:00 app[web.1]: at new DiskStorage (/app/node_modules/multer/storage/disk.js:21:12)
2021-10-15T16:05:32.108036+00:00 app[web.1]: at module.exports (/app/node_modules/multer/storage/disk.js:65:10)
2021-10-15T16:05:32.108036+00:00 app[web.1]: at new Multer (/app/node_modules/multer/index.js:15:20)
2021-10-15T16:05:32.108037+00:00 app[web.1]: at multer (/app/node_modules/multer/index.js:95:12)
2021-10-15T16:05:32.108037+00:00 app[web.1]: at Object.<anonymous> (/app/api/files.js:4:16)
2021-10-15T16:05:32.108037+00:00 app[web.1]: at Module._compile (internal/modules/cjs/loader.js:1085:14) {
2021-10-15T16:05:32.108038+00:00 app[web.1]: errno: -30,
2021-10-15T16:05:32.108041+00:00 app[web.1]: syscall: 'mkdir',
2021-10-15T16:05:32.108041+00:00 app[web.1]: code: 'EROFS',
2021-10-15T16:05:32.108041+00:00 app[web.1]: path: '/public'
2021-10-15T16:05:32.108041+00:00 app[web.1]: }
2021-10-15T16:05:32.267952+00:00 heroku[web.1]: Process exited with status 1
2021-10-15T16:05:32.695933+00:00 heroku[web.1]: State changed from starting to crashed
2021-10-15T16:05:33.707024+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=filedownl12.herokuapp.com request_id=c9fdfd08-1b36-450e-a4de-fb65785677a4 fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T16:05:34.925481+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=filedownl12.herokuapp.com request_id=3aca34c2-47e0-4f99-9884-13b91ed25f99 fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T16:13:09.486503+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=filedownl12.herokuapp.com request_id=e41ba396-2172-4804-a573-0fafc1a2c47b fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
2021-10-15T16:13:10.694600+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=filedownl12.herokuapp.com request_id=4ef46b32-012c-43b2-8342-0a0637d5a29b fwd="77.49.34.161" dyno= connect= service= status=503 bytes= protocol=https
I also tried to be sure if I set the variables for MONGO_URI,I also set them. Also I created a procfile and write inside it
web: node ./server.js
But it didnt works. I lastly want to share my directories picture.
I am trying to deploy a web app on Heroku and it keeps crashing.
After checking the logs, it says it crashed right before starting process with command 'node app.js'
After pushing my app to Heroku Git, I clicked on the link and it gave me a missing script: start.
I added "start": "index.js" to my scripts, replacing the test and return 1 string.
Now, I'm getting a different application error.
Here are the logs:
2019-04-16T15:55:19.291517+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-04-16T15_55_19_283Z-debug.log
2019-04-16T15:55:22.076257+00:00 heroku[web.1]: Starting process with command `npm start`
2019-04-16T15:55:24.008573+00:00 heroku[web.1]: Process exited with status 1
2019-04-16T15:55:24.034855+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-16T15:55:23.952515+00:00 app[web.1]: npm ERR! missing script: start
2019-04-16T15:55:23.958426+00:00 app[web.1]:
2019-04-16T15:55:23.958664+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-04-16T15:55:23.958754+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-04-16T15_55_23_953Z-debug.log
2019-04-16T16:19:04.974643+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-16T16:19:08.471350+00:00 heroku[web.1]: Starting process with command `npm start`
2019-04-16T16:19:10.946953+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-16T16:19:10.920954+00:00 heroku[web.1]: Process exited with status 1
2019-04-16T16:19:10.847576+00:00 app[web.1]: npm ERR! missing script: start
2019-04-16T16:19:10.856940+00:00 app[web.1]:
2019-04-16T16:19:10.862276+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2019-04-16T16:19:10.862279+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2019-04-16T16_19_10_849Z-debug.log
2019-04-16T16:21:52.000000+00:00 app[api]: Build started by user bsautry#ualr.edu
2019-04-16T16:22:14.048093+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-16T16:22:13.644927+00:00 app[api]: Release v4 created by user bsautry#ualr.edu
2019-04-16T16:22:13.644927+00:00 app[api]: Deploy 69b62110 by user bsautry#ualr.edu
2019-04-16T16:22:17.615771+00:00 heroku[web.1]: Starting process with command `node app.js`
2019-04-16T16:22:18.000000+00:00 app[api]: Build succeeded
2019-04-16T16:22:20.049173+00:00 heroku[web.1]: Process exited with status 1
2019-04-16T16:22:20.067122+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-16T16:22:19.975525+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-04-16T16:22:19.975544+00:00 app[web.1]: throw err;
2019-04-16T16:22:19.975546+00:00 app[web.1]: ^
2019-04-16T16:22:19.975548+00:00 app[web.1]:
2019-04-16T16:22:19.975549+00:00 app[web.1]: Error: Cannot find module '/app/app.js'
2019-04-16T16:22:19.975551+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-04-16T16:22:19.975553+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-04-16T16:22:19.975555+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
2019-04-16T16:22:19.975557+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-04-16T16:22:19.975559+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-04-16T16:25:54.162474+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=loveplumbing.herokuapp.com request_id=589c1650-a614-4aae-a8e5-ffb58a523e1e fwd="99.34.148.220" dyno= connect= service= status=503 bytes= protocol=https
2019-04-16T16:25:54.759301+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=loveplumbing.herokuapp.com request_id=3c7f8d06-e415-48ae-952d-3968d12db75c fwd="99.34.148.220" dyno= connect= service= status=503 bytes= protocol=https
2019-04-16T16:30:55.410784+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-16T16:30:58.687945+00:00 heroku[web.1]: Starting process with command `node app.js`
2019-04-16T16:31:01.064389+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-16T16:31:00.983841+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-04-16T16:31:00.983863+00:00 app[web.1]: throw err;
2019-04-16T16:31:00.983865+00:00 app[web.1]: ^
2019-04-16T16:31:00.983866+00:00 app[web.1]:
2019-04-16T16:31:00.983868+00:00 app[web.1]: Error: Cannot find module '/app/app.js'
2019-04-16T16:31:00.983870+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-04-16T16:31:00.983872+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-04-16T16:31:00.983873+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
2019-04-16T16:31:00.983874+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-04-16T16:31:00.983875+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-04-16T16:31:01.040784+00:00 heroku[web.1]: Process exited with status 1
2019-04-16T16:59:14.705641+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-16T16:59:18.023601+00:00 heroku[web.1]: Starting process with command `node app.js`
2019-04-16T16:59:20.925080+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-16T16:59:20.905853+00:00 heroku[web.1]: Process exited with status 1
2019-04-16T16:59:20.804107+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-04-16T16:59:20.804145+00:00 app[web.1]: throw err;
2019-04-16T16:59:20.804147+00:00 app[web.1]: ^
2019-04-16T16:59:20.804149+00:00 app[web.1]:
2019-04-16T16:59:20.804150+00:00 app[web.1]: Error: Cannot find module '/app/app.js'
2019-04-16T16:59:20.804153+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-04-16T16:59:20.804155+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-04-16T16:59:20.804156+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
2019-04-16T16:59:20.804158+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-04-16T16:59:20.804159+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-04-16T17:37:18.987655+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=loveplumbing.herokuapp.com request_id=1fc71b49-e1f4-4e23-b898-9d77035b5e04 fwd="99.34.148.220" dyno= connect= service= status=503 bytes= protocol=https
2019-04-16T17:37:19.514237+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=loveplumbing.herokuapp.com request_id=a9886709-5ec0-49da-adfd-0c02d8378903 fwd="99.34.148.220" dyno= connect= service= status=503 bytes= protocol=https
2019-04-16T17:45:46.000000+00:00 app[api]: Build started by user bsautry#ualr.edu
2019-04-16T17:46:08.863208+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-16T17:46:08.459037+00:00 app[api]: Release v5 created by user bsautry#ualr.edu
2019-04-16T17:46:08.459037+00:00 app[api]: Deploy 9cfd1de3 by user bsautry#ualr.edu
2019-04-16T17:46:12.241604+00:00 heroku[web.1]: Starting process with command `node app.js`
2019-04-16T17:46:13.000000+00:00 app[api]: Build succeeded
2019-04-16T17:46:14.898819+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-16T17:46:14.914929+00:00 heroku[web.1]: State changed from crashed to starting
2019-04-16T17:46:14.882816+00:00 heroku[web.1]: Process exited with status 1
2019-04-16T17:46:14.816039+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-04-16T17:46:14.816072+00:00 app[web.1]: throw err;
2019-04-16T17:46:14.816074+00:00 app[web.1]: ^
2019-04-16T17:46:14.816076+00:00 app[web.1]:
2019-04-16T17:46:14.816078+00:00 app[web.1]: Error: Cannot find module '/app/app.js'
2019-04-16T17:46:14.816080+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-04-16T17:46:14.816081+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-04-16T17:46:14.816083+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
2019-04-16T17:46:14.816084+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-04-16T17:46:14.816086+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-04-16T17:46:19.195129+00:00 heroku[web.1]: Starting process with command `node app.js`
2019-04-16T17:46:22.064061+00:00 heroku[web.1]: State changed from starting to crashed
2019-04-16T17:46:22.040652+00:00 heroku[web.1]: Process exited with status 1
2019-04-16T17:46:21.962948+00:00 app[web.1]: internal/modules/cjs/loader.js:584
2019-04-16T17:46:21.962978+00:00 app[web.1]: throw err;
2019-04-16T17:46:21.962980+00:00 app[web.1]: ^
2019-04-16T17:46:21.962981+00:00 app[web.1]:
2019-04-16T17:46:21.962983+00:00 app[web.1]: Error: Cannot find module '/app/app.js'
2019-04-16T17:46:21.962985+00:00 app[web.1]: at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
2019-04-16T17:46:21.962987+00:00 app[web.1]: at Function.Module._load (internal/modules/cjs/loader.js:508:25)
2019-04-16T17:46:21.962989+00:00 app[web.1]: at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
2019-04-16T17:46:21.962991+00:00 app[web.1]: at startup (internal/bootstrap/node.js:283:19)
2019-04-16T17:46:21.962992+00:00 app[web.1]: at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)
2019-04-16T17:46:22.320545+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=loveplumbing.herokuapp.com request_id=a8e86470-1fee-4159-a683-a4437e46ccbc fwd="99.34.148.220" dyno= connect= service= status=503 bytes= protocol=https
2019-04-16T17:46:23.689417+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=loveplumbing.herokuapp.com request_id=a7e1403a-3ee9-490f-9446-b4d8150761ee fwd="99.34.148.220" dyno= connect= service= status=503 bytes= protocol=https
2019-04-16T17:49:56.610263+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=loveplumbing.herokuapp.com request_id=fac4cd8f-dfce-4023-bc1d-e27e3297cd59 fwd="99.34.148.220" dyno= connect= service= status=503 bytes= protocol=https
2019-04-16T17:49:57.055698+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=loveplumbing.herokuapp.com request_id=b431c26e-62c1-42ca-908d-bbe70be171e4 fwd="99.34.148.220" dyno= connect= service= status=503 bytes= protocol=https
I expect it will be some sort of file naming issue.
Well, according to your error messages
Error: Cannot find module '/app/app.js'
I believe it is trying to find your app.js which is I guess it should be your index.js. What exactly are you using? Angular? If so, check this link as it helped me to understand how to set up an angular project to deploy to heroku.
https://medium.com/#hellotunmbi/how-to-deploy-angular-application-to-heroku-1d56e09c5147
I'm trying to do Todo routes deployed on Heroku successfully but shows application error. When checked the heroku logs file it shows the following error mentioned in Log file
I have used node.js mongodb mongoose and Heroku to deploy with mlab
Node version
Node version node : 8.11.2
Log file
2018-06-23T10:53:43.168794+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-06-23T10:53:43.169086+00:00 app[web.1]: npm ERR!
2018-06-23T10:53:43.169299+00:00 app[web.1]: npm ERR! Failed at the nodetodo#1.0.0 prestart script.
2018-06-23T10:53:43.169500+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-06-23T10:53:43.174385+00:00 app[web.1]:
2018-06-23T10:53:43.174622+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-23T10:53:43.174799+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-06-23T10_53_43_171Z-debug.log
2018-06-23T10:53:43.275561+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-23T10:53:46.634454+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-23T10:53:49.572029+00:00 heroku[web.1]: Process exited with status 1
2018-06-23T10:53:49.589326+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-23T10:53:49.452654+00:00 app[web.1]:
2018-06-23T10:53:49.452675+00:00 app[web.1]: > nodetodo#1.0.0 prestart /app
2018-06-23T10:53:49.452677+00:00 app[web.1]: > next build
2018-06-23T10:53:49.452678+00:00 app[web.1]:
2018-06-23T10:53:49.461849+00:00 app[web.1]: sh: 1: next: not found
2018-06-23T10:53:49.476477+00:00 app[web.1]: npm ERR! file sh
2018-06-23T10:53:49.476762+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-06-23T10:53:49.477051+00:00 app[web.1]: npm ERR! errno ENOENT
2018-06-23T10:53:49.477332+00:00 app[web.1]: npm ERR! syscall spawn
2018-06-23T10:53:49.479006+00:00 app[web.1]: npm ERR! nodetodo#1.0.0 prestart: `next build`
2018-06-23T10:53:49.479274+00:00 app[web.1]: npm ERR! spawn ENOENT
2018-06-23T10:53:49.479567+00:00 app[web.1]: npm ERR!
2018-06-23T10:53:49.479782+00:00 app[web.1]: npm ERR! Failed at the nodetodo#1.0.0 prestart script.
2018-06-23T10:53:49.479988+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-06-23T10:53:49.488380+00:00 app[web.1]:
2018-06-23T10:53:49.488650+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-23T10:53:49.488830+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-06-23T10_53_49_481Z-debug.log
2018-06-23T10:53:57.235315+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/todos" host=glacial-mesa-32050.herokuapp.com request_id=0cbc6b93-45b5-4e60-a716-6e87f9cfe8b5 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:53:57.875585+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=glacial-mesa-32050.herokuapp.com request_id=8a8c1304-b9ca-4684-8306-a70dca54e911 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:54:00.250909+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/todos" host=glacial-mesa-32050.herokuapp.com request_id=d4de12e1-d453-4a62-9ee0-4a99e2f78051 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:54:00.896607+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=glacial-mesa-32050.herokuapp.com request_id=8e52a8d5-2bd2-4e95-a8e6-7e43c21bd369 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:54:04.255637+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/todos" host=glacial-mesa-32050.herokuapp.com request_id=8d68216f-f176-4f79-91b5-cb10b02c8fc3 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:54:04.866164+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=glacial-mesa-32050.herokuapp.com request_id=5ebf6203-d866-42ff-baf7-f57179248c73 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:54:06.844189+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/todos" host=glacial-mesa-32050.herokuapp.com request_id=11ce1294-b8a5-4046-ad2b-1db482422355 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:54:07.474661+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=glacial-mesa-32050.herokuapp.com request_id=98c0098c-c969-4491-99d3-aa6f29eb836f fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:57:10.708198+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=glacial-mesa-32050.herokuapp.com request_id=b3fc81b7-4a7a-438c-8482-e0b68b8e52d0 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:57:11.197790+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=glacial-mesa-32050.herokuapp.com request_id=b8c7fff9-7304-4e63-8fea-50d9e7525cf2 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:57:21.844958+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/todos" host=glacial-mesa-32050.herokuapp.com request_id=b0fa0c40-3fed-4da9-b680-6b55864ae418 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T10:57:24.013893+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=glacial-mesa-32050.herokuapp.com request_id=8b0ac5ed-ea76-4ee4-b1a8-99ba8520c986 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T11:05:45.000000+00:00 app[api]: Build started by user #gmail.com
2018-06-23T11:05:58.286485+00:00 app[api]: Deploy 6ab35c64 by user #gmail.com
2018-06-23T11:05:58.286485+00:00 app[api]: Release v5 created by user #gmail.com
2018-06-23T11:05:58.000000+00:00 app[api]: Build succeeded
2018-06-23T11:06:00.741880+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-23T11:06:04.111616+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-23T11:06:06.707945+00:00 app[web.1]:
2018-06-23T11:06:06.707971+00:00 app[web.1]: > nodetodo#1.0.0 start /app
2018-06-23T11:06:06.707972+00:00 app[web.1]: > node server/server.js
2018-06-23T11:06:06.707974+00:00 app[web.1]:
2018-06-23T11:06:07.594283+00:00 app[web.1]: Started at port 38896
2018-06-23T11:06:07.622294+00:00 app[web.1]:
2018-06-23T11:06:07.622298+00:00 app[web.1]: /app/node_modules/mongoose/node_modules/mongodb/lib/server.js:242
2018-06-23T11:06:07.622300+00:00 app[web.1]: process.nextTick(function() { throw err; })
2018-06-23T11:06:07.622302+00:00 app[web.1]: ^
2018-06-23T11:06:07.622338+00:00 app[web.1]: Error: connect ECONNREFUSED 127.0.0.1:27017
2018-06-23T11:06:07.622340+00:00 app[web.1]: at Object._errnoException (util.js:992:11)
2018-06-23T11:06:07.622342+00:00 app[web.1]: at _exceptionWithHostPort (util.js:1014:20)
2018-06-23T11:06:07.622344+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
2018-06-23T11:06:07.632652+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-06-23T11:06:07.633131+00:00 app[web.1]: npm ERR! errno 1
2018-06-23T11:06:07.634834+00:00 app[web.1]: npm ERR! nodetodo#1.0.0 start: `node server/server.js`
2018-06-23T11:06:07.635359+00:00 app[web.1]: npm ERR!
2018-06-23T11:06:07.635590+00:00 app[web.1]: npm ERR! Failed at the nodetodo#1.0.0 start script.
2018-06-23T11:06:07.635057+00:00 app[web.1]: npm ERR! Exit status 1
2018-06-23T11:06:07.635807+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-06-23T11:06:07.642357+00:00 app[web.1]:
2018-06-23T11:06:07.642642+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-23T11:06:07.642830+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-06-23T11_06_07_637Z-debug.log
2018-06-23T11:06:07.695625+00:00 heroku[web.1]: Process exited with status 1
2018-06-23T11:06:07.822414+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-23T11:06:07.826000+00:00 heroku[web.1]: State changed from crashed to starting
2018-06-23T11:06:10.546996+00:00 heroku[web.1]: Starting process with command `npm start`
2018-06-23T11:06:12.650782+00:00 app[web.1]:
2018-06-23T11:06:12.650804+00:00 app[web.1]: > nodetodo#1.0.0 start /app
2018-06-23T11:06:12.650806+00:00 app[web.1]: > node server/server.js
2018-06-23T11:06:12.650807+00:00 app[web.1]:
2018-06-23T11:06:13.248399+00:00 app[web.1]: Started at port 4126
2018-06-23T11:06:13.264689+00:00 app[web.1]:
2018-06-23T11:06:13.264697+00:00 app[web.1]: process.nextTick(function() { throw err; })
2018-06-23T11:06:13.264695+00:00 app[web.1]: /app/node_modules/mongoose/node_modules/mongodb/lib/server.js:242
2018-06-23T11:06:13.264699+00:00 app[web.1]: ^
2018-06-23T11:06:13.264700+00:00 app[web.1]: Error: connect ECONNREFUSED 127.0.0.1:27017
2018-06-23T11:06:13.264701+00:00 app[web.1]: at Object._errnoException (util.js:992:11)
2018-06-23T11:06:13.264703+00:00 app[web.1]: at _exceptionWithHostPort (util.js:1014:20)
2018-06-23T11:06:13.264705+00:00 app[web.1]: at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1186:14)
2018-06-23T11:06:13.271195+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2018-06-23T11:06:13.271503+00:00 app[web.1]: npm ERR! errno 1
2018-06-23T11:06:13.272534+00:00 app[web.1]: npm ERR! nodetodo#1.0.0 start: `node server/server.js`
2018-06-23T11:06:13.272816+00:00 app[web.1]: npm ERR!
2018-06-23T11:06:13.272926+00:00 app[web.1]: npm ERR! Failed at the nodetodo#1.0.0 start script.
2018-06-23T11:06:13.272642+00:00 app[web.1]: npm ERR! Exit status 1
2018-06-23T11:06:13.273028+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2018-06-23T11:06:13.276839+00:00 app[web.1]:
2018-06-23T11:06:13.276972+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2018-06-23T11:06:13.277055+00:00 app[web.1]: npm ERR! /app/.npm/_logs/2018-06-23T11_06_13_274Z-debug.log
2018-06-23T11:06:13.324927+00:00 heroku[web.1]: Process exited with status 1
2018-06-23T11:06:13.471063+00:00 heroku[web.1]: State changed from starting to crashed
2018-06-23T11:06:20.993262+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=glacial-mesa-32050.herokuapp.com request_id=6458108b-77d2-485c-ba53-9e523f8fff7f fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
2018-06-23T11:06:21.472089+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=glacial-mesa-32050.herokuapp.com request_id=dc99750e-aaba-4fc9-b7f5-fde727eb6201 fwd="111.91.116.52" dyno= connect= service= status=503 bytes= protocol=https
JSON file
{
"name": "nodetodo",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"start": "node server/server.js",
"test": "mocha server/**/*.test.js",
"test-watch": "nodemon --exec \"npm test\""
},
"engines": {
"node": "8.11.2"
},
"author": "",
"license": "ISC",
"dependencies": {
"body-parser": "^1.18.3",
"express": "^4.16.3",
"mongodb": "^2.2.35",
"mongoose": "^4.5.9"
},
"devDependencies": {
"expect": "^1.20.2",
"mocha": "^3.0.2",
"nodemon": "^1.10.2",
"supertest": "^2.0.0"
}
}
Please help
Have you tried npm cache clean -f ?
Okay, this error could be due to two reasons, so make sure you have followed these steps right
Make sure to bind your port
const PORT = process.env.PORT || 4126;
app.listen(PORT);
Make sure that you connect to online database and not to your local database.Use mlab uri. https://mlab.com/ Use this link for help Learn Mlab
I have a very simple app that works fine locally, but I am having problems on heroku. I'm unable to get the app deployed.
My main file is index.js. Any idea why I'm getting the npm ERR! argv?
I'm also getting a timeout request near the bottom, but I'm pretty sure that's because of the error at the top, but I can't find any information on how to fix that.
My Procfile:
web: node index.js
Heroku Logs
2016-01-04T03:13:40.069853+00:00 app[web.1]: at node.js:974:3
2016-01-04T03:13:40.098240+00:00 app[web.1]:
2016-01-04T03:13:40.116214+00:00 app[web.1]: npm ERR! argv "/app/.heroku/node/bin/node" "/app/.heroku/node/bin/npm" "start"
2016-01-04T03:13:40.116460+00:00 app[web.1]: npm ERR! node v5.1.1
2016-01-04T03:13:40.117293+00:00 app[web.1]: npm ERR! npm v3.3.12
2016-01-04T03:13:40.117565+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2016-01-04T03:13:40.117685+00:00 app[web.1]: npm ERR! 3-broadcast#1.0.0 start: `node index.js`
2016-01-04T03:13:40.117852+00:00 app[web.1]: npm ERR! Exit status 1
2016-01-04T03:13:40.118043+00:00 app[web.1]: npm ERR!
2016-01-04T03:13:40.118238+00:00 app[web.1]: npm ERR! Failed at the 3-broadcast#1.0.0 start script 'node index.js'.
2016-01-04T03:13:40.126696+00:00 app[web.1]: npm ERR! Make sure you have the latest version of node.js and npm installed.
2016-01-04T03:13:40.126957+00:00 app[web.1]: npm ERR! If you do, this is most likely a problem with the 3-broadcast package,
2016-01-04T03:13:40.127149+00:00 app[web.1]: npm ERR! not with npm itself.
2016-01-04T03:13:40.127352+00:00 app[web.1]: npm ERR! Tell the author that this fails on your system:
2016-01-04T03:13:40.127528+00:00 app[web.1]: npm ERR! node index.js
2016-01-04T03:13:40.127726+00:00 app[web.1]: npm ERR! You can get their info via:
2016-01-04T03:13:40.057500+00:00 app[web.1]: module.js:340
2016-01-04T03:13:40.127892+00:00 app[web.1]: npm ERR! npm owner ls 3-broadcast
2016-01-04T03:13:40.115774+00:00 app[web.1]: npm ERR! Linux 3.13.0-71-generic
2016-01-04T03:13:40.128057+00:00 app[web.1]: npm ERR! There is likely additional logging output above.
2016-01-04T03:13:40.142232+00:00 app[web.1]: npm ERR! Please include the following file with any support request:
2016-01-04T03:13:40.142468+00:00 app[web.1]: npm ERR! /app/npm-debug.log
2016-01-04T03:13:40.131714+00:00 app[web.1]:
2016-01-04T03:13:41.074138+00:00 heroku[web.1]: Process exited with status 1
2016-01-04T03:13:58.421558+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=blueredcircles.herokuapp.com request_id=e17561ec-a72c-4bda-a828-89d94b467eca fwd="67.202.159.95" dyno= connect= service= status=503 bytes=
2016-01-04T03:13:58.846066+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/favicon.ico" host=blueredcircles.herokuapp.com request_id=f43b9355-785a-46c6-8b4b-d8242850eefa fwd="67.202.159.95" dyno= connect= service= status=503 bytes=
2016-01-04T03:13:41.079689+00:00 heroku[web.1]: State changed from starting to crashed
2016-01-04T03:13:34.108622+00:00 heroku[web.1]: State changed from crashed to starting
2016-01-04T03:16:03.635321+00:00 heroku[api]: Deploy b368561 by john.steven.curry#gmail.com
2016-01-04T03:16:03.635321+00:00 heroku[api]: Release v5 created by john.steven.curry#gmail.com
2016-01-04T03:16:03.859376+00:00 heroku[slug-compiler]: Slug compilation started
2016-01-04T03:16:03.859386+00:00 heroku[slug-compiler]: Slug compilation finished
2016-01-04T03:16:05.130278+00:00 heroku[web.1]: Starting process with command `npm start`
2016-01-04T03:16:07.541724+00:00 app[web.1]:
2016-01-04T03:16:07.541734+00:00 app[web.1]: > 3-broadcast#1.0.0 start /app
2016-01-04T03:16:07.541735+00:00 app[web.1]: > node server.js
2016-01-04T03:16:07.541736+00:00 app[web.1]:
2016-01-04T03:16:08.850108+00:00 heroku[web.1]: State changed from starting to up
2016-01-04T03:17:00.281412+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=blueredcircles.herokuapp.com request_id=51a122b3-29cf-4990-bdd3-87876aff7eb9 fwd="67.202.159.95" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0
2016-01-04T03:17:34.578076+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=blueredcircles.herokuapp.com request_id=ea1ec7e0-9d21-4b75-a178-b1459c7f7b26 fwd="67.202.159.95" dyno=web.1 connect=0ms service=30008ms status=503 bytes=0
2016-01-04T03:19:02.419204+00:00 heroku[api]: Deploy 455f4b9 by john.steven.curry#gmail.com
2016-01-04T03:19:02.419204+00:00 heroku[api]: Release v6 created by john.steven.curry#gmail.com
2016-01-04T03:19:02.554096+00:00 heroku[slug-compiler]: Slug compilation started
2016-01-04T03:19:02.554106+00:00 heroku[slug-compiler]: Slug compilation finished
2016-01-04T03:19:02.521646+00:00 heroku[web.1]: State changed from up to starting
2016-01-04T03:19:03.765155+00:00 heroku[web.1]: Starting process with command `npm start`
2016-01-04T03:19:06.461660+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-01-04T03:19:06.859284+00:00 app[web.1]:
2016-01-04T03:19:06.859295+00:00 app[web.1]: > node server.js
2016-01-04T03:19:06.859293+00:00 app[web.1]: > 3-broadcast#1.0.0 start /app
2016-01-04T03:19:06.859295+00:00 app[web.1]:
2016-01-04T03:19:07.496859+00:00 heroku[web.1]: State changed from starting to up
2016-01-04T03:19:07.678179+00:00 app[web.1]: Error waiting for process to terminate: No child processes
2016-01-04T03:19:08.417595+00:00 heroku[web.1]: Process exited with status 22
2016-01-04T03:19:41.947257+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=blueredcircles.herokuapp.com request_id=9c09f36a-907f-46f8-987a-6643c4a8c812 fwd="67.202.159.95" dyno=web.1 connect=0ms service=30013ms status=503 bytes=0
2016-01-04T03:20:12.792172+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=blueredcircles.herokuapp.com request_id=13122c47-3da7-4225-8ecb-456e02300e98 fwd="67.202.159.95" dyno=web.1 connect=2ms service=30000ms status=503 bytes=0
2016-01-04T03:30:30.747148+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=blueredcircles.herokuapp.com request_id=173c5f06-e37f-4d58-851d-09a657bc6471 fwd="67.202.159.95" dyno=web.1 connect=0ms service=30000ms status=503 bytes=0
2016-01-04T03:31:01.607943+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=blueredcircles.herokuapp.com request_id=5a9b793c-33b7-4cbc-ba79-7d3fd03d6c9d fwd="67.202.159.95" dyno=web.1 connect=0ms service=30001ms status=503 bytes=0
2016-01-04T03:35:45.503236+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=blueredcircles.herokuapp.com request_id=0619c426-5b9f-4466-9149-23a25c9f2c9f fwd="67.202.159.95" dyno=web.1 connect=2ms service=30001ms status=503 bytes=0
2016-01-04T03:36:16.605008+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=blueredcircles.herokuapp.com request_id=7041b988-7754-4daf-b2cc-aa59d47af6a9 fwd="67.202.159.95" dyno=web.1 connect=1ms service=30000ms status=503 bytes=0
2016-01-04T03:51:14.197715+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-01-04T03:51:09.664826+00:00 heroku[web.1]: Idling
2016-01-04T03:51:09.665575+00:00 heroku[web.1]: State changed from up to down
2016-01-04T03:59:35.268346+00:00 heroku[api]: Deploy 76810f5 by john.steven.curry#gmail.com
2016-01-04T03:59:35.268417+00:00 heroku[api]: Release v7 created by john.steven.curry#gmail.com
2016-01-04T03:59:35.419230+00:00 heroku[slug-compiler]: Slug compilation started
2016-01-04T03:59:35.419242+00:00 heroku[slug-compiler]: Slug compilation finished
2016-01-04T03:59:43.936272+00:00 heroku[web.1]: Unidling
2016-01-04T03:59:43.936548+00:00 heroku[web.1]: State changed from down to starting
2016-01-04T03:59:45.379956+00:00 heroku[web.1]: Starting process with command `npm start`
2016-01-04T03:59:48.386628+00:00 app[web.1]:
2016-01-04T03:59:48.386638+00:00 app[web.1]: > 3-broadcast#1.0.0 start /app
2016-01-04T03:59:48.386639+00:00 app[web.1]: > node index.js
2016-01-04T03:59:48.386640+00:00 app[web.1]:
2016-01-04T04:00:21.016181+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=blueredcircles.herokuapp.com request_id=adb01525-d9ab-4218-aeb9-d83663fa5c44 fwd="67.202.159.95" dyno=web.1 connect=8ms service=30001ms status=503 bytes=0
2016-01-04T04:00:52.022088+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=blueredcircles.herokuapp.com request_id=644b6a2e-7f10-45ca-96d4-160ed0c57511 fwd="67.202.159.95" dyno=web.1 connect=2ms service=30000ms status=503 bytes=0
2016-01-04T04:12:47.063010+00:00 heroku[slug-compiler]: Slug compilation started
2016-01-04T04:12:47.063020+00:00 heroku[slug-compiler]: Slug compilation finished
2016-01-04T04:12:46.926357+00:00 heroku[api]: Deploy ac9051e by john.steven.curry#gmail.com
2016-01-04T04:12:46.926395+00:00 heroku[api]: Release v8 created by john.steven.curry#gmail.com
2016-01-04T04:12:48.336084+00:00 heroku[web.1]: Starting process with command `node index.js`
2016-01-04T04:12:52.744593+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-01-04T04:12:54.916240+00:00 heroku[web.1]: Process exited with status 143
2016-01-04T04:13:38.172796+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/" host=blueredcircles.herokuapp.com request_id=e2a82fa4-2cde-41c8-9ced-f07b364bc5cf fwd="67.202.159.95" dyno=web.1 connect=2ms service=30000ms status=503 bytes=0
2016-01-04T04:14:09.018120+00:00 heroku[router]: at=error code=H12 desc="Request timeout" method=GET path="/favicon.ico" host=blueredcircles.herokuapp.com request_id=42ff0959-f6b2-40a7-bd91-e133440a7219 fwd="67.202.159.95" dyno=web.1 connect=1ms service=30007ms status=503 bytes=0
2016-01-04T04:22:13.685866+00:00 heroku[api]: Deploy cd095d8 by john.steven.curry#gmail.com
2016-01-04T04:22:13.685900+00:00 heroku[api]: Release v9 created by john.steven.curry#gmail.com
2016-01-04T04:22:13.818747+00:00 heroku[slug-compiler]: Slug compilation started
2016-01-04T04:22:13.818760+00:00 heroku[slug-compiler]: Slug compilation finished
2016-01-04T04:22:13.808044+00:00 heroku[web.1]: State changed from up to starting
2016-01-04T04:22:14.560498+00:00 heroku[web.1]: Starting process with command `node index.js`
2016-01-04T04:22:15.616097+00:00 heroku[web.1]: State changed from starting to up
2016-01-04T04:22:18.806289+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-01-04T04:22:21.385366+00:00 heroku[web.1]: Process exited with status 143
2016-01-04T04:27:40.534025+00:00 heroku[api]: Release v10 created by john.steven.curry#gmail.com
2016-01-04T04:27:40.533989+00:00 heroku[api]: Deploy 992d387 by john.steven.curry#gmail.com
2016-01-04T04:27:40.664281+00:00 heroku[slug-compiler]: Slug compilation started
2016-01-04T04:27:40.664290+00:00 heroku[slug-compiler]: Slug compilation finished
2016-01-04T04:27:41.813131+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2016-01-04T04:27:41.873956+00:00 heroku[web.1]: Starting process with command `node index.js`
2016-01-04T04:27:42.582874+00:00 heroku[web.1]: Process exited with status 143
index.js:
var app = require('http').createServer();
var io = require('socket.io')(app);
app.listen(process.env.PORT || 8000);
io.on('connection', function(socket) {
var alert = 'test hello from server :) ' + Math.random();
socket.on('change color', function(){
socket.broadcast.emit('change color');
});
socket.on('disconnect', function(){
console.log('1 client disconnected');
});
});
"engines": {
"node": "9.4.0",
"npm": "5.6.0"
}
Add these in your package.json file.
EDIT:
Your Heroku npm version should be compatible with your node version running on the device.