npm ERR! Error: EPERM: operation not permitted, rename

NPM is a node package manager used to manage the node plugins in your project powered by Node.js. Node.js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on the V8 engine and executes JavaScript code outside a web browser.

Also read: How To Install Linux, Apache, MySQL, PHP on Ubuntu 18.04

Errors are a common thing in web development scenarios. We will face many challenges when used many plugins that have dependencies. Likewise, a Node JS project contains different plugins of its own and the errors will occur in the development stages.

When I execute npm install I get this error

npm install command will install all the dependencies in your project. It may return an error when your system environment is not matched or when the plugin mismatch.

npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\xampp\htdocs\techbiriyani\node_modules\acorn-node\package.json.263234427
npm ERR! dest C:\xampp\htdocs\techbiriyani\node_modules\acorn-node\package.json
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\techbiriyani\node_modules\acorn-node\package.json.263234427' -> 'C:\xampp\htdocs\techbiriyani\node_modules\acorn-node\package.json'
npm ERR!  [OperationalError: EPERM: operation not permitted, rename 'C:\xampp\htdocs\techbiriyani\node_modules\acorn-node\package.json.263234427' -> 'C:\xampp\htdocs\techbiriyani\node_modules\acorn-node\package.json'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, rename 'C:\xampp\htdocs\techbiriyani\node_modules\acorn-node\package.json.263234427' -> 'C:\xampp\htdocs\techbiriyani\node_modules\acorn-node\package.json'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'rename',
npm ERR!     path: 'C:\\xampp\\htdocs\\techbiriyani\\node_modules\\acorn-node\\package.json.263234427',
npm ERR!     dest: 'C:\\xampp\\htdocs\\techbiriyani\\node_modules\\acorn-node\\package.json'
npm ERR!   },

Steps to reproduce

I was getting the same issue, npm cache clean fixed it for me 🙂

Conclusion

When you migrate your project to another system or when you have too many caches in your project this error may occur. Hope the npm cache clean will fix it for you.

Follow TechBiriyani on FacebookTwitter to get all the latest updates.

By Shahas Nizar

A passionate blogger and a tech enthusiast who is always keen and awaiting to know about fully fledged new technologies who's currently using iPhone 12 as a part of daily routine. You can spot me @ #facebook, #twitter & #Google +

Leave a Reply