node.js - npm install -g @vue/cli VUE CLI安装错误
问题描述
我只是想安装 Vue CLI,但我收到了这个错误。我有最新版本的 node.js,如下所示。我尝试了一些不同的方法,例如npm uninstall -g vue-cli
and 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
解决方案
我在终端中下载 Vue 时遇到了同样的问题。我通过使用解决了这个问题:
sudo npm install -g @vue/cli
然后我检查它是否正确安装并且是最新的:
vue --version
推荐阅读
- python - 如何在 django 中使两个模型相互关联(反之亦然)。一个公司应该有多个目录,但一个目录只能有一个公司
- python-3.x - 如何在 Python + Selenium 中使用 cookie 来抓取网站
- sql - SQL - 选择子查询中的最后一条记录,包括其他条件
- javascript - React 中的其他组件未检测到存储更改 - MobX
- python - LSTM,多输入:3 天 *(136 个元素的数组 + 2 个整数)
- c# - unity scrollRect 没有通过脚本滚动到最后
- c++ - 从输入文件中读取参数与将其设置为 .h 文件中的静态常量 - 编译器优化
- python - 使用 python 从文档中识别与金融相关的单词
- ffmpeg - ffmpeg 安装:pkg-config 找不到包(使用 Homebrew)
- css - Google 移动可用性 > 内容比屏幕更宽