CJCoding With Joseph
15free / daySign inCreate account

NodeJs

Making Your First Server

First, create a new folder on your computer and name it My First Server. Next, open it in VS Code. You can do this by right clicking the folder and choosing Open with Code, or by dragging the folder into VS Code.

Once it is open, open the terminal inside VS Code. You can do this by pressing Ctrl + ` (the backtick key) or by going to View > Terminal.

Make sure the terminal shows that you are inside your project folder. You can confirm this by typing: pwd. This command shows your current location on the computer. Mine looks like this:

PS C:\Users\josep\Desktop\My First Server> pwd
Path
----
C:\Users\josep\Desktop\My First Server

If your path looks different, that is perfectly fine. As long as it ends with My First Server (Or whatever you named the folder), you are in the right spot.


Initialize your project

Now we need to create a package.json file. This file stores information about your project and what tools or packages it will use.

In your terminal, type: npm init

You will see a few setup questions appear:

Members only

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 8 more lessons in NodeJs.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel any time.