Overview
npm i -y
npm i dotenv express hbs mysql
npm i –save nodemon
Double-check that your package.json file has the “scripts” section defined with the “start” script. It should look like this:
1
2
3"scripts": {
"start": "nodemon app.js"
}
you run npm start in terminal.
cannot start mysql in xampp
The most likely reason that XAMPP’s MySQL service is unable to start is because port 3306 is already used by a different program that is currently running on your computer. By default, XAMPP’s MySQL service binds to port 3306 when started, and it can only do so if another program is not already using it.
To ascertain whether this is the case, you can click on the Netstat button to open up a window with a list of all the ports that are being used on your computer currently. If port 3306 is in the list when you haven’t started MySQL on XAMPP, this means that another program is using it.
Use the Netstat window to check if port 3306 has already been occupied.
To remedy this, you will need to find the process that is using port 3306 and end the process. In the example above, a process called mysqld.exe is using port 3306. To stop it, I will have to use Ctrl + Alt + Delete to open up the Task Manager, then find and end the mysqld.exe process.
If your Task Manager doesn’t show all the processes, click on More details at the bottom of the window to get the full Task Manager window.
“/“ vs. “./“
“/“ means it will look into the public static file to look for a certain file
“./“ means it will go to the current path