欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

解決安裝vue3腳手架@vue/cli報4048錯誤問題

 更新時間:2024年07月18日 08:51:45   作者:無憂好奇貓  
這篇文章主要介紹了解決安裝vue3腳手架@vue/cli報4048錯誤問題,具有很好的參考價值,希望對大家有所幫助,如有錯誤或未考慮完全的地方,望不吝賜教

安裝vue3腳手架@vue/cli報4048錯誤

@vue/cli報錯在網(wǎng)上試了很多解決辦法,這個最有用了,一定要試試

C:\Users\25077>npm install vue-cli -g
npm ERR! code EPERM
npm ERR! syscall mkdir
npm ERR! path E:\Node\node_modules\.vue-cli-7tLVKUJI
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, mkdir 'E:\Node\node_modules\.vue-cli-7tLVKUJI'
npm ERR!  [Error: EPERM: operation not permitted, mkdir 'E:\Node\node_modules\.vue-cli-7tLVKUJI'] {
npm ERR!   errno: -4048,
npm ERR!   code: 'EPERM',
npm ERR!   syscall: 'mkdir',
npm ERR!   path: 'E:\\Node\\node_modules\\.vue-cli-7tLVKUJI'
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\25077\AppData\Local\npm-cache\_logs\2022-02-16T08_15_05_960Z-debug-0.log

C:\Users\25077>npm install vue-cli -g

報如上錯誤是系統(tǒng)權(quán)限不夠,(方法:通過目錄找C:\Windows\System32\cmd.exe,然后右鍵單擊,出現(xiàn)選項(xiàng),選擇以管理員身份運(yùn)行即可)

然后再次輸入安裝命令:npm install @vue/cli -g即可安裝成功。

通過輸入vue -V,查看vue版本,如果能出來下圖則安裝成功

vue-cli3.0踩坑(4048和 Failed at the chromedriver@2.46.0 install script)錯誤

因?yàn)関ue-cli3.0流行,我卸載了舊的node,并安裝v12版本的node和vue/cli 4.5.4。正因此我遇到坑了。

當(dāng)我下載公司的一個vue項(xiàng)目后,執(zhí)行了 npm install命令后,踩坑之路開始

坑1:遇到4048錯誤

遇到問題當(dāng)然先百度了,很多人都說

  • 解決方案1:在該目錄下執(zhí)行 npm cache clean –force 清理緩存,然后再次 npm install
  • 解決方案2: 刪除C:\Users{賬戶}\下的.npmrc文件

我先執(zhí)行了1,不好用,再執(zhí)行了2。

執(zhí)行完2之后,雖然解決了4048錯誤,但又遇到了一個坑

坑2:Failed at the chromedriver@2.46.0 install script

于是我再百度,很多人又說該問題是vue-cli腳手架的一個bug,原因是chromedriver的部分文件被國內(nèi)網(wǎng)絡(luò)給墻掉了,無法下載完整的chromedirver包

解決辦法 :

npm install chromedriver --chromedriver_cdnurl=http://cdn.npm.taobao.org/dist/chromedriver

執(zhí)行完之后,我繼續(xù)npm install,還是報同樣的錯誤。

于是在百度,有人說如果上面的這個命令不行的話

  • 1:npm install --ignore-scripts
  • 2:npm i

執(zhí)行完二者后,我再npm install

好像解決了問題~

總結(jié)

以上為個人經(jīng)驗(yàn),希望能給大家一個參考,也希望大家多多支持腳本之家。

相關(guān)文章

最新評論