【发布时间】:2021-02-13 06:46:36
【问题描述】:
我只是想安装 Vue CLI,但出现了这个错误。我有最新版本的 node.js,如下所示。我尝试了一些不同的方法,例如npm uninstall -g vue-cli 和npm cache clean --force。但他们没有工作。我该如何解决?
我的 npm 版本是 7.0.3。
C:\Users\HALİL_MONSTER>NODE
Welcome to Node.js v15.0.1.
Type ".help" for more information.
C:\Users\HALİL_MONSTER>npm install -g @vue/cli
npm ERR! code EPERM
npm ERR! syscall rename
npm ERR! path C:\Users\HALİL_MONSTER\AppData\Roaming\npm\node_modules\@vue\cli
npm ERR! dest C:\Users\HALİL_MONSTER\AppData\Roaming\npm\node_modules\@vue\.cli-P415H8gb
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rename 'C:\Users\HALİL_MONSTER\AppData\Roaming\npm\node_modules\@vue\cli' -> 'C:\Users\HALİL_MONSTER\AppData\Roaming\npm\node_modules\@vue\.cli-P415H8gb'
npm ERR! [Error: EPERM: operation not permitted, rename 'C:\Users\HALİL_MONSTER\AppData\Roaming\npm\node_modules\@vue\cli' -> 'C:\Users\HALİL_MONSTER\AppData\Roaming\npm\node_modules\@vue\.cli-P415H8gb'] {
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rename',
npm ERR! path: 'C:\\Users\\HALİL_MONSTER\\AppData\\Roaming\\npm\\node_modules\\@vue\\cli',
npm ERR! dest: 'C:\\Users\\HALİL_MONSTER\\AppData\\Roaming\\npm\\node_modules\\@vue\\.cli-P415H8gb'
npm ERR! }
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.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HALİL_MONSTER\AppData\Local\npm-cache\_logs\2020-10-30T19_06_23_457Z-debug.log
【问题讨论】:
-
试试
npm install -g @vue/cli --unsafe-perm
标签: node.js vue.js npm-install vue-cli