Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install nodemon Nodejs on macOS? nodemon keeping show : command not found

Currently I already install nodemon with command npm install -g nodemon. And I got Permissions issue, so I do command with sudo npm install -g nodemon and i did it. But when I make "nodeman" command was always show nodemon: command not found.

like image 265
Slamet Riyadi Avatar asked Jun 20 '19 13:06

Slamet Riyadi


Video Answer


2 Answers

If for any reasons you are unable to set a Global PATH then under your current project directory, run

npm install nodemon --save-dev

then under "scripts" in your package.json file, add "start": "nodemon app.js" like this -

"scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "nodemon app.js"
}

then run

npm start
like image 102
Darshan Devrai Avatar answered Oct 18 '22 23:10

Darshan Devrai


If you need to install nodemon globally on mac OS, try

sudo npm install -g nodemon.

Then you'll have to enter your password. Once the installation is completed successfully, run

nodemon -v

to check nodemon version on terminal.

like image 11
Randil Tennakoon Avatar answered Oct 19 '22 00:10

Randil Tennakoon