Home > Back-end >  npm install -g nodemon err! How do I get through this err
npm install -g nodemon err! How do I get through this err

Time:09-06

I am studying node js, express. When I try to install 'nodemon', Error messages keep coming out.

  1. What kind of error message is this?
  2. What can I do to resolve it?
  3. What should I study to learn about the route setting of Nodejs?

I ask for your help.

error page

⬇ err messages is here ⬇

npm ERR! code EACCES
npm ERR! syscall mkdir
npm ERR! path /usr/local/lib/node_modules/nodemon
npm ERR! errno -13
npm ERR! Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nodemon'
npm ERR! [Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/nodemon'] {
npm ERR! errno: -13,
npm ERR! code: 'EACCES',
npm ERR! syscall: 'mkdir',
npm ERR! path: '/usr/local/lib/node_modules/nodemon' npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/mac/.npm/_logs/2022-09-05T12_16_18_604Z-debug-0.log


And I put this 'npm install nodemon' on the terminal.

then it seems like install complete.

  1. What is the difference of these ( npm install nodemon / npm -g install nodemon )

enter image description here

CodePudding user response:

-g is used for global installation.

Try npm install nodemon in your project.

CodePudding user response:

Use sudo to run the command:

sudo npm i - g nodemon

Have a look at : Problem installing nodemon globally on macOS Mojave

  • Related