Setting up a Node.js development environment | A pain-free guide

1. Go to Node’s website and download the latest version of Node.js. Install it

2. Open terminal and cd into wherever you want your code to be

Ex: cd ~/Documents/my-site

3. In terminal, run npm init. Answer the questions

4. Run touch app.js to create a file name app.js

5. Run npm install express

6. Open app.js in your favorite text editor. Write this code:

7. Run node app.js

8. Open a browser and go to localhost:3000 and you should see ‘Hello, World!’


This is a pain-free guide. If you want a detailed guide, check out this post.