ryanmurakami / pizza-luvrs

❤️🍕🍕❤️ Demo project for AWS Developer: Getting Started on Pluralsight
114 stars 255 forks source link

Unable to start the application on Windows 10. NPM install gives 64 vulnerabilities. #18

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi, I am new to both AWS and NODEJS and am preparing certification via your pluralsight course. Tried performing npm install as stated in your course but had some audit fix issues. Ran Audit fix --force and then tried to run npm start.. ending with below errors. Please help.

D:\AWS\pizza-luvrs-master\pizza-luvrs-master>npm start

pizza-luvrs@1.0.0 start D:\AWS\pizza-luvrs-master\pizza-luvrs-master node index.js

D:\AWS\pizza-luvrs-master\pizza-luvrs-master\index.js:6 server.connection({ port: process.env.PORT || 3000 }); ^

TypeError: server.connection is not a function at Object. (D:\AWS\pizza-luvrs-master\pizza-luvrs-master\index.js:6:8) at Module._compile (internal/modules/cjs/loader.js:689:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10) at Module.load (internal/modules/cjs/loader.js:599:32) at tryModuleLoad (internal/modules/cjs/loader.js:538:12) at Function.Module._load (internal/modules/cjs/loader.js:530:3) at Function.Module.runMain (internal/modules/cjs/loader.js:742:12) at startup (internal/bootstrap/node.js:266:19) at bootstrapNodeJSCore (internal/bootstrap/node.js:596:3) npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! pizza-luvrs@1.0.0 start: node index.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the pizza-luvrs@1.0.0 start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

ryanmurakami commented 6 years ago

Hi @that-bombay-girl, It looks like when you did that audit fix, it updated hapi to the most recent version (somewhere around v17). hapi is pretty aggressive with updating their API, so the code in my project won't work with that version.

I think you have two options. 1) You could revert the audit change (just delete the repo and start over) and accept the vulnerabilities. Since this isn't going to production, I think this is the best option. 2) Update the code in the project to work with the new hapi. There are tutorials you can use here: https://hapijs.com/tutorials. I don't recommend this approach, because you likely want to focus on the AWS portion of the course and not get mired in fixing Node.js specific things.

Good luck! Hope this helps, Ryan

ghost commented 6 years ago

Hi Ryan, Apologies if this is a very basic question but I am new to both aws as well as nodejs.In pluralsight module, you mentioned to either download the code from exercise files or via github. Then you mention to go to the the directory where the code is extracted and then run : npm install. When I run this command, it shows me ~69 vulnerabilities.1. How to accept those vulnerabilities and continue the installation ? The npm install just throws errors and comes out back to shell prompt.2. It prompts me to audit fix and manually fix all of those. I am not sure how to do it Thanks for response.Nikita Sent from Yahoo Mail on Android

On Sat, 15 Sep 2018 at 9:46 PM, Ryan Lewisnotifications@github.com wrote:
Hi @that-bombay-girl, It looks like when you did that audit fix, it updated hapi to the most recent version (somewhere around v17). hapi is pretty aggressive with updating their API, so the code in my project won't work with that version.

I think you have two options. 1) You could revert the audit change (just delete the repo and start over) and accept the vulnerabilities. Since this isn't going to production, I think this is the best option. 2) Update the code in the project to work with the new hapi. There are tutorials you can use here: https://hapijs.com/tutorials. I don't recommend this approach, because you likely want to focus on the AWS portion of the course and not get mired in fixing Node.js specific things.

Good luck! Hope this helps, Ryan

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ryanmurakami commented 6 years ago

Hi Nikita, The vulnerability notifications don't get in the way of installing the code. You should have a node_modules folder with all your dependencies in there. If you want a fresh install, delete the node_modules folder and then run npm install again. You should see an output message like: added 161 packages from 205 contributors in 13.57s

ghost commented 6 years ago

Yes after this message when I run the npm start to see if pizza luvrs application should come up on localhost:3000 it gives me the error I wrote on github.Maybe its connection error on port 3000 I am not sure. I am not sure how to proceed ahead now 

Sent from Yahoo Mail on Android

On Sat, 15 Sep 2018 at 9:58 PM, Ryan Lewisnotifications@github.com wrote:
Hi Nikita, The vulnerability notifications don't get in the way of installing the code. You should have a node_modules folder with all your dependencies in there. If you want a fresh install, delete the node_modules folder and then run npm install again. You should see an output message like: added 161 packages from 205 contributors in 13.57s

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

ryanmurakami commented 6 years ago

The reason you got the original error is because the version of the hapi dependency is v17. This project will only work with v13, so you need to downgrade. Running npm audit fix is what updated hapi and that needs to be undone. The easiest thing is to delete the entire pizza-luvrs repo and then re-pull it.