Sunday, May 12, 2024
 Popular · Latest · Hot · Upcoming
85
rated 0 times [  87] [ 2]  / answers: 1 / hits: 16275  / 7 Years ago, tue, april 11, 2017, 12:00:00

I'm a student going into back-end development for the first time and are trying to learn Node.JS. I downloaded a pdf book about Node.JS from sitepoint called: Jumpstart Node.JS. In following the instructions to set up the server on the command line, install the dependencies, and navigate to localhost:3000, i got nothing except the following message: Connection refused: localhost:3000, Can somebody please tell me what might have went wrong and how to fix it?



Edit1:
The instructions i followed is about setting up a node.js server using the Node command line, thus no code, simply cmd commands, however, here is a quick summary of the process i followed:




  1. Created an account on MongoLabs and then a database using the free pricing plan.

  2. Installed express using the command: npm install -g [email protected].

  3. Created an applications with default options using this command: express authentication.

  4. modified the package.json file in system32

  5. installed the dependencies by typing cd authentication, hitting enter, and then typing the command: npm install

  6. Typed node app and hit enter.
    According to the instructions i should have seen a message: Welcome to express but instead got the error message.


More From » node.js

 Answers
89

In following the instructions to set up the server on the command line, install the dependencies, and navigate to localhost:3000




It seems that you didn't start the server.



Somewhere between installing the dependencies and navigating to the URL you need to actually start the server if you want it to serve the request.


[#58192] Sunday, April 9, 2017, 7 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
laytonlamontm

Total Points: 745
Total Questions: 130
Total Answers: 130

Location: Cambodia
Member since Thu, Oct 7, 2021
3 Years ago
;