After install NodeJS (sudo apt install nodejs
or download direct from website)
Verify if NodeJS was correctly installed by typing node -v
on terminal, it must return any version number.
So, if you doesn't create a project folder, it's time. Then, on your folder, type npm init -y
to set up a npm package. It must create a package.json
file.
After that, install express package by typing npm i express
on terminal. It will create a package-lock.json
file, don't worry about it (and never change it manually).
To create a simple route, just to verify if everything is ok, let's create a .js file (e.g. server.js
) on project folder.