DebugFactor.com | Forum

Not able to install react-bootstrap, getting this error “Error: EPERM: operation not permitted, rename amplifyapp\node_modules\...”. How to fix this?

I am trying to install bootstrap in my react application. The application is configured with AWS Amplify if it makes any differences.

npm ERR! syscall rename
npm ERR! path \\node_modules\\@types\\react\\package.json.1544010678
npm ERR! dest \\node_modules\\@types\\react\\package.json
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename '\\node_modules\\@types\\react\\package.json.1544010678' -> '\\node_modules\\@types\\react\\package.json'
npm ERR! [OperationalError: EPERM: operation not permitted, rename '\\node_modules\\@types\\react\\package.json.1544010678' -> '\\node_modules\\@types\\react\\package.json'] {

Looks like package.json is locked by some process. You may have to find out which process is using this file and stop/kill that process.
I have also seen that sometimes npm cache clear fixes this issue,

npm cache clean --force