Why can't I update or install a new npm modules? - node.js

npm i -g nodemon#latest
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\nodemon
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\nodemon'
npm ERR! [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\nodemon'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\nodemon'
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\Lenovo\AppData\Local\npm-cache\_logs\2021-02-18T12_22_33_254Z-debug.log
----------

Related

I get an error when i am installing global package

npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\nodemon
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\nodemon'
npm ERR! [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\nodemon'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\Program Files\\nodejs\\node_modules\\nodemon'
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\User\AppData\Local\npm-cache\_logs\2022-09-13T03_52_41_827Z-debug-0.log

NPM - Error: EPERM: operation not permitted, mkdir 'C:\'

New to nodejs and npm. I have installed nodejs and npm using nvm for windows. Now no matter what library I try to install I get:
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\'
npm ERR! [Error: EPERM: operation not permitted, mkdir 'C:\'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'mkdir',
npm ERR! path: 'C:\\'
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\xxxxxx\AppData\Local\npm-cache\_logs\2021-03-03T16_56_40_199Z-debug.log
I've tried clearing the cache, changing the install path, setting the prefix at both the command line and in the config file. Any more suggestions?
Thanks!

React native, unable to install expo-cli

I just start learning react native. While installing expo npm install -g expo cli I'm getting that error. Can someone Tell me why?
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\Lenovo\AppData\Roaming\npm\node_modules\expo-cli
npm ERR! dest C:\Users\Lenovo\AppData\Roaming\npm\node_modules\.expo-cli-DcNrljQz
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Lenovo\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\Lenovo\AppData\Roaming\npm\node_modules\.expo-cli-DcNrljQz'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\Lenovo\AppData\Roaming\npm\node_modules\expo-cli' -> 'C:\Users\Lenovo\AppData\Roaming\npm\node_modules\.expo-cli-DcNrljQz'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\Lenovo\\AppData\\Roaming\\npm\\node_modules\\expo-cli',
npm ERR! dest: 'C:\\Users\\Lenovo\\AppData\\Roaming\\npm\\node_modules\\.expo-cli-DcNrljQz'
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\Lenovo\AppData\Local\npm-cache\_logs\2021-02-16T13_28_45_327Z-debug.log

Error when running "npm install --save express"

PS C:\Users\Lenovo\node express> npm install --save express
npm WARN node-express#1.0.0 No description
npm WARN node-express#1.0.0 No repository field.
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\Lenovo\node express\node_modules\content-disposition\package.json.3642225889
npm ERR! dest C:\Users\Lenovo\node express\node_modules\content-disposition\package.json
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\Lenovo\node express\node_modules\content-disposition\package.json.3642225889' -> 'C:\Users\Lenovo\node express\node_modules\content-disposition\package.json'
npm ERR! [OperationalError: EPERM: operation not permitted, rename 'C:\Users\Lenovo\node express\node_modules\content-disposition\package.json.3642225889' -> 'C:\Users\Lenovo\node express\node_modules\content-disposition\package.json'] {
npm ERR! cause: [Error: EPERM: operation not permitted, rename 'C:\Users\Lenovo\node express\node_modules\content-disposition\package.json.3642225889' -> 'C:\Users\Lenovo\node express\node_modules\content-disposition\package.json'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\Lenovo\\node express\\node_modules\\content-disposition\\package.json.3642225889',
npm ERR! dest: 'C:\\Users\\Lenovo\\node express\\node_modules\\content-disposition\\package.json'
npm ERR! },
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\Lenovo\\node express\\node_modules\\content-disposition\\package.json.3642225889',
npm ERR! dest: 'C:\\Users\\Lenovo\\node express\\node_modules\\content-disposition\\package.json',
npm ERR! parent: 'node express'
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\Lenovo\AppData\Roaming\npm-cache\_logs\2020-12-21T17_33_56_539Z-debug.log
PS C:\Users\Lenovo\node express>

Error on npm install gatsby-plugin-styled-components

I am trying to install these npm packages
npm install --save gatsby-plugin-styled-components styled-components babel-plugin-styled-components
I am using node version 10.11.0
However I get the following error, I have tried running it in power-shell in administrator mode made no difference
npm ERR! path C:\Users\Anders\sites\pro-gatsby\node_modules\#types\events\npm-shrinkwrap.json
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall open
npm ERR! Error: EPERM: operation not permitted, open 'C:\Users\Anders\sites\pro-gatsby\node_modules\#types\events\npm-shrinkwrap.json'
npm ERR! { [Error: EPERM: operation not permitted, open 'C:\Users\Anders\sites\pro-gatsby\node_modules\#types\events\npm-shrinkwrap.json']
npm ERR! cause:
npm ERR! { Error: EPERM: operation not permitted, open 'C:\Users\Anders\sites\pro-gatsby\node_modules\#types\events\npm-shrinkwrap.json'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path:
npm ERR! 'C:\\Users\\Anders\\sites\\pro-gatsby\\node_modules\\#types\\events\\npm-shrinkwrap.json' },
npm ERR! isOperational: true,
npm ERR! stack:
npm ERR! 'Error: EPERM: operation not permitted, open \'C:\\Users\\Anders\\sites\\pro-gatsby\\node_modules\\#types\\events\\npm-shrinkwrap.json\'',
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'open',
npm ERR! path:
npm ERR! 'C:\\Users\\Anders\\sites\\pro-gatsby\\node_modules\\#types\\events\\npm-shrinkwrap.json',
npm ERR! parent: '#types/glob' }
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 (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Anders\AppData\Roaming\npm-cache\_logs\2018-10-20T22_44_07_361Z-debug.log
Remove node_modules
npm cache clean
Try to install again
Should help.

Resources