First create simple Server:-
Create a simple folder named "server" or whatever you want to name it. Like that:
By using the terminal, go to the server folder and write npm init
, then press enter. Like that:
Like that, if you want to add some detail, then add it.
After that you sow a file in your server folder package.json .
Now use Nodemon with a Node.js project:-
Create a folder inside the server folder named src, and inside the src folder create index.js.
Now go to the terminal and run this command to install nodemon: npm install nodemon
You saw in the package.json file:
Your nodemon package may be in another or the same. Try to install the latest version of nodemon.
Next, add some scripts in the scripts section of the package.json file. :-
I added the path of the index.js file in dev and I added the start script.
Next, go to the terminal and run the command npm run dev. Now you are done.