How to resolve EPERM: operation not permitted error in webpack command?
The following error message occurs when using webpack. PS C:\Workspace\Mission> npm run dev
> webpack-demo@1.0.0 dev
> webpack --mode=development
[webpack-cli] [Error: EPERM: operation not permitted, open 'C:\Workspace\Mission\dist\px.bundle.js'] {
errno: -4048,
code: 'EPERM',
syscall: 'open',
path: 'C:\\Workspace\\Mission\\dist\\px.bundle.js'
}
Running the npm cache clean --force command works fine.
However, if I run the npm run dev command 3 or 4 times, the same error repeats again.
I gave the account admin rights, and I also gave full control to the folder. I tried running it in admin mode, but it didn't work.
How to fix this error?