npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted……解决方法

windows安装nmp组件时,报错:

npm ERR! code EPERM
npm ERR! syscall unlink
npm ERR! path C:\nodejs12\node_modules\.staging\mime-b44a72a1\LICENSE
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, unlink 'C:\nodejs12\node_modules\.staging\mime-b44a72a1\LICENSE'
npm ERR!  [OperationalError: EPERM: operation not permitted, unlink 'C:\nodejs12\node_modules\.staging\mime-b44a72a1\LICENSE'] {

 

网上有各种解决办法,清缓存、用管理员执行……

其实没有那么麻烦,找到报错的文件,比如我的是C:\nodejs12\node_modules\.staging\mime-b44a72a1\LICENSE,进入C:\nodejs12\node_modules\.staging,删除mime-b44a72a1,重新执行即可。

 

你可能感兴趣的:(npm install 报错(npm ERR! errno -4048,Error: EPERM: operation not permitted……解决方法)