0

i go to install nodemon globall it's display error. how i fix this?

C:\Users\nipuna\Desktop\nodejs>npm install -g nodemon
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\nodemon\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! Unexpected end of JSON input while parsing near '...^2.0.1","sinon":"^8.1'

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\nipuna\AppData\Roaming\npm-cache\_logs\2020-04-29T07_51_50_127Z-debug.log
Dinitha ransidhu
  • 99
  • 1
  • 2
  • 4

1 Answers1

0

Install nodemon globally:

C:\>npm install -g nodemon

Get prefix:

C:\>npm config get prefix

You will get output like following in your console:

C:\Users\Family\.node_modules_global

Copy it.

Set Path:

Now Run the below command with the copied path:

set PATH=%PATH%; C:\Users\Family\.node_modules_global

Now Run nodemon:

C:\>nodemon .
Sebastian Simon
  • 18,263
  • 7
  • 55
  • 75