How to eradicate npm error operation not permitted, scandir "xxx"

Environment

  • windows 7 operating system
  • npm 5.5.1

Business background

when installing and deleting packages through npm,
items are placed on the desktop, that is,
often reports this error in the system disk

npm install --save-dev file-loader
// ,,
 Error: EPERM: operation not permitted, scandir "....
......`
 Please try running this command again as root/Administrator.

temporary measures to deal with

  1. git bash is set to start as an administrator
  2. npm cache clean-force
  3. Delete npm-cache folder
  4. under the user directory
  5. and then reinstall it

question

what can be done to eradicate this problem?
it"s really annoying to delete cache files every time you install a package

Npm
Mar.01,2021

you run git bash as an administrator, delete this directory, and then run git bash as normal. There will be no problems in the future

.
Menu