簡體   English   中英

npm install -g @vue/cli VUE CLI 安裝錯誤

[英]npm install -g @vue/cli VUE CLI INSTALL ERROR

我只是想安裝 Vue CLI,但出現此錯誤。 我有最新版本的 node.js,如下所示。 我嘗試了一些不同的方法,比如npm uninstall -g vue-clinpm 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

我正在使用 Windows 7 和 nodejs 13。我遇到了同樣的問題。 我試過重新啟動我的電腦,添加標志等。沒有任何效果。 最后我用紗線解決了它。

  1. 使用 npm 安裝紗線: npm install --global yarn
  2. 使用yarn安裝vue cli:yarn global add @vue/cli
  3. 配置vue cli安裝的系統路徑。 yarn 不會在目錄中安裝 vue cli 作為 npm

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM