Reputation: 21
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'
npm ERR! [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\.npm-QXjMEw5N'
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
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! C:\Users\ACER\AppData\Local\npm-cache\_logs\2021-06-01T20_20_59_514Z-debug.log
i run npm install -g nodemon
but it gives the error above
Upvotes: 2
Views: 147
Reputation: 31
Try to clear your cache then install again? Something like npm cache clear --force then npm i
Upvotes: 0
Reputation: 5411
You can understand what is happening by reading the error log
EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.npm-QXjMEw5N'
EPERM is the code for the permission issue. Here, you cannot create (mkdir) a new directory called .npm-QXjMEw5N inside C:\Program Files\nodejs\node_modules\
because you don't have the permission to do that.
Macro: int EPERM “Operation not permitted.”
Only the owner of the file (or other resource) or processes with special privileges can perform the operation.
You can try running the command line as administrator to have the appropriate privilege, then rerun npm install -g nodemon
Upvotes: 2