0

I'm trying to install nodemon globally, but I'm getting warning as mentioned in attached picture. May be because of warning, I'm not able to run nodemon. My package.json

  {
   "name": "learn",
   "version": "1.0.0",
   "description": "",
   "main": "server.js",
   "scripts": {
   "test": "echo \"Error: no test specified\" && exit 1",
   "start": "node server.js"
  },
   "author": "himanshu",
   "license": "ISC",
   "dependencies": {
   "bcrypt-nodejs": "0.0.3",
   "body-parser": "^1.17.2",
   "express": "^4.15.4",
   "mongoose": "^4.11.7",
   "morgan": "^1.8.2"
  }
 }

enter image description here

Himanshu Shekhar
  • 1,196
  • 1
  • 16
  • 35
  • execute `nodemon server.js` instead of just `server` in your command – Satish Patel Aug 17 '17 at 10:43
  • @SatishPatel I tried nodemon server.js also, but failed... I'm not getting what Warning no.2 means... {"os":"darwin","arch":"any"} – Himanshu Shekhar Aug 17 '17 at 10:53
  • what is the messege you got once you executed nodemon server.js? – Satish Patel Aug 17 '17 at 10:57
  • 1
    https://stackoverflow.com/questions/40226745/npm-warn-notsup-skipping-optional-dependency-unsupported-platform-for-fsevents for clarification about the warnings you are getting – Satish Patel Aug 17 '17 at 10:57
  • While installing nodemon I'm getting two warning. And when I run my server file, either nodemon server or nodemon serve.js , I'm getting same error , "nodemon' is not recognized as an internal or external command, operable program or batch file." – Himanshu Shekhar Aug 17 '17 at 10:59
  • are you able to run your server app via `node server.js`? – Satish Patel Aug 17 '17 at 11:00
  • Yes, node server and node server.js both are running. – Himanshu Shekhar Aug 17 '17 at 11:00
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/152141/discussion-between-satish-patel-and-himanshu-shekhar). – Satish Patel Aug 17 '17 at 11:04
  • 1
    Open command prompt and do following `npm config get prefix` and append the output of above command to `PATH` for example: o/p `C:\Users\username\AppData\Roaming\npm` Do as `set PATH=%PATH%;C:\Users\username\AppData\Roaming\npm` – Satish Patel Aug 17 '17 at 11:17
  • after this if you still face the issue then you run again the `npm install nodemon -g` and you can use `nodemon` easily – Satish Patel Aug 17 '17 at 11:24
  • Thanks a lot Patel Bhai.. First this one not work then, I manually removed nodemon.cmd and nodemon file from the location "C:\Users\username\AppData\Roaming\npm" , then again i follow your instruction.. Now its running Fine... Thank You Bhai.. OnceAgain – Himanshu Shekhar Aug 17 '17 at 13:15

1 Answers1

1

I have added C:\Users\username\AppData\Roaming\npm to the environment variables of my system and it solved my issue.

Biswadev
  • 1,456
  • 11
  • 24