npm install
This command installs all the modules listed in the package.json
npm install myModule
The .env
file contains sensitive information like authentification credentials for MongoDB
The .env
must be placed in the project root folder.
npm run dev
If the script is not defined, you must add it into the package.json
{
[...],
"scripts": {
"dev": "nodemon"
},
[...]
}
Also, make sure the main
property points to the correct file, Ex:
{
[...],
"main": "src/index.js",
[...]
}
npm install -G nodemon
This installes the nodemon package globally. It can be used outside the project.
If you cannot install and use nodemon globally you can install it the project
npm install nodemon --dev
The --dev
flag indicates that this package is necessary only for the project's development.
If you installed nodemon
locally you need to change the "dev"
script like this:
{
[...],
"scripts": {
"dev": "npx nodemon"
},
[...]
}