StephenGrider / FullstackReactCode

Companion repo to https://www.udemy.com/node-with-react-fullstack-web-development
1.39k stars 1.17k forks source link

Video 53/54 - Errors in deployment #1

Open MincePie opened 7 years ago

MincePie commented 7 years ago

Hi Stephen,

I'm stuck at video 53/54 of your course. I have posted my question here: https://www.udemy.com/node-with-react-fullstack-web-development/learn/v4/questions/2720370

I have spent the last 12 hours goolging these issues and in relation to the errors, the best understanding I can reach is that react and heroku are incompatible in the way in which they process some parts of the code. Is that correct? If so, do you have a work around that is not currently included in the course materials?

In relation to the deprecation warnings, the MongoDB documents set out alternative ways in which to address the problems. Is there any advice on which alternative to choose?

I'm stuck. I've bought so many of these tutorials and am not getting anywhere with any of them for reasons that I just can't make any sense of. I'd love to find the grounding fundamentals course that would give me something to work with when these problems arise.

Thank you in advance.

heroku open
MacBook-Pro:cf mm$ heroku logs
2017-08-20T22:43:40.596085+00:00 heroku[router]: at=info method=GET path="/auth/google" host=xxx-.herokuapp.com request_id=xxx  fwd="202.191.1.40" dyno=web.1 connect=0ms service=3ms status=302 bytes=389 protocol=https
2017-08-20T22:54:06.000000+00:00 app[api]: Build started by user himl@gmail.com
2017-08-20T22:54:19.091802+00:00 heroku[web.1]: Restarting
2017-08-20T22:54:19.091802+00:00 heroku[web.1]: State changed from up to starting
2017-08-20T22:54:18.831121+00:00 app[api]: Deploy da8d8b92 by user himl@gmail.com
2017-08-20T22:54:18.831121+00:00 app[api]: Release v11 created by user himl@gmail.com
2017-08-20T22:54:06.000000+00:00 app[api]: Build succeeded
2017-08-20T22:54:19.688562+00:00 app[web.1]: Error waiting for process to terminate: No child processes
2017-08-20T22:54:19.649237+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-08-20T22:54:19.760418+00:00 heroku[web.1]: Process exited with status 22
2017-08-20T22:54:20.680662+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-20T22:54:23.109022+00:00 app[web.1]: > cf@1.0.0 start /app
2017-08-20T22:54:23.109023+00:00 app[web.1]: > node index.js
2017-08-20T22:54:23.109002+00:00 app[web.1]: 
2017-08-20T22:54:23.109023+00:00 app[web.1]: 
2017-08-20T22:54:23.653124+00:00 app[web.1]: (node:17) DeprecationWarning: `open()` is deprecated in mongoose >= 4.11.0, use `openUri()` instead, or set the `useMongoClient` option if using `connect()` or `createConnection()`. See mongoosejs.com/docs/connections.html#use-mongo-client
2017-08-20T22:54:23.677395+00:00 app[web.1]: Db.prototype.authenticate method will no longer be available in the next major release 3.x as MongoDB 3.6 will only allow auth against users in the admin db and will no longer allow multiple credentials on a socket. Please authenticate using MongoClient.connect with auth credentials.
2017-08-20T22:54:24.282097+00:00 heroku[web.1]: State changed from starting to up
2017-08-20T22:54:28.023299+00:00 heroku[router]: at=info method=GET path="/" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno=web.1 connect=0ms service=16ms status=404 bytes=383 protocol=https
2017-08-20T22:54:34.447414+00:00 heroku[router]: at=info method=GET path="/auth/google" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno=web.1 connect=1ms service=5ms status=302 bytes=390 protocol=https
2017-08-20T22:54:34.873730+00:00 heroku[router]: at=info method=GET path="/auth/google" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno=web.1 connect=1ms service=3ms status=302 bytes=390 protocol=https
2017-08-20T22:54:57.205162+00:00 heroku[router]: at=info method=GET path="/auth/google/callback?code=4/NHpaYlY-zJDmeXsmDyNWLYH4gzZbrB9BYlXckQcO3gE" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno=web.1 connect=1ms service=877ms status=404 bytes=666 protocol=https
2017-08-20T22:54:57.136700+00:00 app[web.1]: (node:17) DeprecationWarning: Mongoose: mpromise (mongoose's default promise library) is deprecated, plug in your own promise library instead: ://mongoosejs.com/docs/promises.html
2017-08-20T22:55:13.781475+00:00 heroku[router]: at=info method=GET path="/api/current_user" host=xxx.herokuapp.com request_id=8d83bd4f-f941-47c0-a8fa-d13f37054f4d fwd="202.191.1.40" dyno=web.1 connect=1ms service=12ms status=200 bytes=284 protocol=https
2017-08-20T23:30:39.073527+00:00 heroku[web.1]: Idling
2017-08-20T23:30:39.074206+00:00 heroku[web.1]: State changed from up to down
2017-08-20T23:30:39.530685+00:00 heroku[web.1]: Stopping all processes with SIGTERM
2017-08-20T23:30:39.599337+00:00 heroku[web.1]: Process exited with status 143
2017-08-21T00:41:03.000000+00:00 app[api]: Build started by user himl@gmail.com
2017-08-21T00:41:03.000000+00:00 app[api]: Build failed -- check your build logs
2017-08-21T00:41:57.000000+00:00 app[api]: Build started by user himl@gmail.com
2017-08-21T00:42:10.723166+00:00 app[api]: Release v12 created by user himl@gmail.com
2017-08-21T00:42:10.723166+00:00 app[api]: Deploy 8c377296 by user himl@gmail.com
2017-08-21T00:41:57.000000+00:00 app[api]: Build succeeded
2017-08-21T00:42:11.559452+00:00 heroku[web.1]: State changed from down to starting
2017-08-21T00:42:13.579690+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-21T00:42:16.699529+00:00 app[web.1]: 
2017-08-21T00:42:16.699542+00:00 app[web.1]: > cf@1.0.0 start /app
2017-08-21T00:42:16.699543+00:00 app[web.1]: 
2017-08-21T00:42:16.780417+00:00 app[web.1]: module.js:487
2017-08-21T00:42:16.780419+00:00 app[web.1]:     throw err;
2017-08-21T00:42:16.780419+00:00 app[web.1]:     ^
2017-08-21T00:42:16.699543+00:00 app[web.1]: > node index.js
2017-08-21T00:42:16.780420+00:00 app[web.1]: 
2017-08-21T00:42:16.780421+00:00 app[web.1]: Error: Cannot find module 'express'
2017-08-21T00:42:16.780422+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:485:15)
2017-08-21T00:42:16.780422+00:00 app[web.1]:     at Function.Module._load (module.js:437:25)
2017-08-21T00:42:16.780423+00:00 app[web.1]:     at Module.require (module.js:513:17)
2017-08-21T00:42:16.780424+00:00 app[web.1]:     at require (internal/module.js:11:18)
2017-08-21T00:42:16.780424+00:00 app[web.1]:     at Object.<anonymous> (/app/index.js:1:79)
2017-08-21T00:42:16.780425+00:00 app[web.1]:     at Module._compile (module.js:569:30)
2017-08-21T00:42:16.780425+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:580:10)
2017-08-21T00:42:16.780426+00:00 app[web.1]:     at Module.load (module.js:503:32)
2017-08-21T00:42:16.780427+00:00 app[web.1]:     at tryModuleLoad (module.js:466:12)
2017-08-21T00:42:16.780427+00:00 app[web.1]:     at Function.Module._load (module.js:458:3)
2017-08-21T00:42:16.822911+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-08-21T00:42:16.823143+00:00 app[web.1]: npm ERR! errno 1
2017-08-21T00:42:16.823290+00:00 app[web.1]: npm ERR! cf@1.0.0 start: `node index.js`
2017-08-21T00:42:16.823396+00:00 app[web.1]: npm ERR! Exit status 1
2017-08-21T00:42:16.823479+00:00 app[web.1]: npm ERR! 
2017-08-21T00:42:16.823578+00:00 app[web.1]: npm ERR! Failed at the cf@1.0.0 start script.
2017-08-21T00:42:16.823659+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-08-21T00:42:16.825226+00:00 app[web.1]: 
2017-08-21T00:42:16.825441+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-08-21T00:42:16.825537+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2017-08-21T00_42_16_788Z-debug.log
2017-08-21T00:42:16.928117+00:00 heroku[web.1]: State changed from starting to crashed
2017-08-21T00:42:16.929881+00:00 heroku[web.1]: State changed from crashed to starting
2017-08-21T00:42:16.918763+00:00 heroku[web.1]: Process exited with status 1
2017-08-21T00:42:19.139547+00:00 heroku[web.1]: Starting process with command `npm start`
2017-08-21T00:42:22.508755+00:00 heroku[web.1]: Process exited with status 1
2017-08-21T00:42:22.294142+00:00 app[web.1]: 
2017-08-21T00:42:22.401167+00:00 app[web.1]: Error: Cannot find module 'express'
2017-08-21T00:42:22.401165+00:00 app[web.1]:     throw err;
2017-08-21T00:42:22.401166+00:00 app[web.1]:     ^
2017-08-21T00:42:22.294161+00:00 app[web.1]: > node index.js
2017-08-21T00:42:22.294162+00:00 app[web.1]: 
2017-08-21T00:42:22.294160+00:00 app[web.1]: > cf@1.0.0 start /app
2017-08-21T00:42:22.401166+00:00 app[web.1]: 
2017-08-21T00:42:22.401168+00:00 app[web.1]:     at Function.Module._resolveFilename (module.js:485:15)
2017-08-21T00:42:22.401169+00:00 app[web.1]:     at Function.Module._load (module.js:437:25)
2017-08-21T00:42:22.401170+00:00 app[web.1]:     at require (internal/module.js:11:18)
2017-08-21T00:42:22.401172+00:00 app[web.1]:     at Module.load (module.js:503:32)
2017-08-21T00:42:22.401163+00:00 app[web.1]: module.js:487
2017-08-21T00:42:22.401171+00:00 app[web.1]:     at Module._compile (module.js:569:30)
2017-08-21T00:42:22.401170+00:00 app[web.1]:     at Object.<anonymous> (/app/index.js:1:79)
2017-08-21T00:42:22.401169+00:00 app[web.1]:     at Module.require (module.js:513:17)
2017-08-21T00:42:22.401172+00:00 app[web.1]:     at Object.Module._extensions..js (module.js:580:10)
2017-08-21T00:42:22.401173+00:00 app[web.1]:     at tryModuleLoad (module.js:466:12)
2017-08-21T00:42:22.417939+00:00 app[web.1]: npm ERR! errno 1
2017-08-21T00:42:22.418688+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2017-08-21T00:42:22.417716+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2017-08-21T00:42:22.401173+00:00 app[web.1]:     at Function.Module._load (module.js:458:3)
2017-08-21T00:42:22.420013+00:00 app[web.1]: 
2017-08-21T00:42:22.420279+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2017-08-21T00:42:22.420383+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2017-08-21T00_42_22_411Z-debug.log
2017-08-21T00:42:22.418095+00:00 app[web.1]: npm ERR! cf@1.0.0 start: `node index.js`
2017-08-21T00:42:22.418216+00:00 app[web.1]: npm ERR! Exit status 1
2017-08-21T00:42:22.418357+00:00 app[web.1]: npm ERR! 
2017-08-21T00:42:22.418560+00:00 app[web.1]: npm ERR! Failed at the cf@1.0.0 start script.
2017-08-21T00:42:22.521212+00:00 heroku[web.1]: State changed from starting to crashed
2017-08-21T00:42:29.122886+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=xxx.herokuapp.com request_id=xxx fwd="202.191.1.40" dyno= connect= service= status=503 bytes= protocol=https
beardedguru commented 6 years ago

It looks like it can't find the express module. Do you have it setup as required at the top of the page index.js file?

tcbhardwaj commented 6 years ago

agree with @beardedguru and also check package.json -> dependency section. there must available similar row "express": "^4.16.3",