【Vue】 安装Vuex,报错Error: EPERM: operation not permitted, rename

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/TheBestAge/article/details/89074241

Vue中安装vuex,出现错误如下:

npm ERR! path F:\fristvue\node_modules\vue-loader
npm ERR! code EPERM
npm ERR! errno -4048
npm ERR! syscall rename
npm ERR! Error: EPERM: operation not permitted, rename 'F:\fristvue\node_modules\vue-loader' -> 'F:\fristvue\node_modules\.vue-loader.DELETE'
npm ERR!  { [Error: EPERM: operation not permitted, rename 'F:\fristvue\node_modules\vue-loader' -> 'F:\fristvue\node_modules\.vue-loader.DELETE']
npm ERR!   cause:
npm ERR!    { Error: EPERM: operation not permitted, rename 'F:\fristvue\node_modules\vue-loader' -> 'F:\fristvue\node_modules\.vue-loader.DELETE'
npm ERR!      errno: -4048,
npm ERR!      code: 'EPERM',
npm ERR!      syscall: 'rename',
npm ERR!      path: 'F:\\fristvue\\node_modules\\vue-loader',
npm ERR!      dest: 'F:\\fristvue\\node_modules\\.vue-loader.DELETE' },
npm ERR!   stack:
npm ERR!    'Error: EPERM: operation not permitted, rename \'F:\\fristvue\\node_modules\\vue-loader\' -> \'F:\\fristvue\\node_modules\\.vue-loader.DELETE\'',
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'rename',
npm ERR!   path: 'F:\\fristvue\\node_modules\\vue-loader',
npm ERR!   dest: 'F:\\fristvue\\node_modules\\.vue-loader.DELETE',
npm ERR!   parent: 'fristvue' }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It's possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2019-04-07T11_22_51_179Z-debug.log

解决方案:
1.在管理员权限下运行命令
开始选择命令提示符(管理员)
2.在指定目录下清理缓存

npm cache clean -force

3.重新安装

npm install vuex --save

在这里插入图片描述

相关资料链接:
npm犯错!错误:EPERM:操作不允许,重命名
npm+EPERM+operation+not+permitted+rename解决

猜你喜欢

转载自blog.csdn.net/TheBestAge/article/details/89074241