簡體   English   中英

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

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

我在 PC/Windows 10,node15.0.0,npm 6.14.8

我只是想安裝 Vue CLI,但出現此錯誤。

我有最新版本的 Node.js,如下所示。 我嘗試了一些不同的方法,比如npm uninstall -g vue-clinpm cache clean --force ,但是,它沒有用。

npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path C:\Program Files\nodejs\node_modules\.staging
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'
npm ERR!  [OperationalError: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!   cause: [Error: EPERM: operation not permitted, mkdir 'C:\Program Files\nodejs\node_modules\.staging'] {
npm ERR!     errno: -4048,
npm ERR!     code: 'EPERM',
npm ERR!     syscall: 'mkdir',
npm ERR!     path: 'C:\\Program Files\\nodejs\\node_modules\\.staging'
npm ERR!   },
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'C:\\Program Files\\nodejs\\node_modules\\.staging',
npm ERR!   parent: '@babel/core'
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\lixin yang\AppData\Roaming\npm-cache\_logs\2020-10-31T14_42_05_231Z-debug.log

知道這意味着什么以及如何解決嗎?

我發現除了按回車我什么也做不了

可能的修復:

  1. 以管理員身份打開 cmd - 搜索 cmd,右鍵單擊,然后以管理員身份打開。
  2. 運行此命令npm cache clean --force
  3. 在這個管理員 cmd 中再次 npm install。

如果還是不行,關閉所有節點進程,然后重試這些步驟,也可以在系統重啟后嘗試這些步驟。

暫無
暫無

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

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