目錄
前言
一、遇到報錯
二、報錯的原因
三、解決辦法
方法一(試試)
方法二(試試)
方法三(換終端)
方法四(終極必殺)?
四、解決成功截圖
五、相似的錯誤參考
前言
從方法一到方法三都試試了,終于解決這個npm問題了,其實就是文件的授權(quán)問題和這個執(zhí)行終端的選擇問題。?第四個方法是終極方法,就是抹除自己的默認依賴下載位置,達到還原效果。
一、遇到報錯
npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path D:\IT_base\node18\node_cache\_cacache\tmp\712dc97e
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open 'D:\IT_base\node18\node_cache\_cacache\tmp\712dc97e'
npm ERR! ?[Error: EPERM: operation not permitted, open 'D:\IT_base\node18\node_cache\_cacache\tmp\712dc97e'] {
npm ERR! ? errno: -4048,
npm ERR! ? code: 'EPERM',
npm ERR! ? syscall: 'open',
npm ERR! ? path: 'D:\\IT_base\\node18\\node_cache\\_cacache\\tmp\\712dc97e'
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! Log files were not written due to an error writing to the directory: D:\IT_base\node18\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
二、報錯的原因
這是因為node目錄下自己配的這些文件夾權(quán)限不夠
三、解決辦法
方法一(試試)
既然是權(quán)限不夠,那就把這些文件的權(quán)限都開啟起來
1.任選3個其中一個,右鍵點擊屬性
?2.點擊編輯
3.點擊完全控制,出現(xiàn)什么容器枚舉錯誤也不要管。剩下的兩個文件夾也是一樣,把權(quán)限給足夠
ps:如果還不行,就這些用戶把權(quán)限都給上
?4.如果用vscode或者idea打開的,就把這兩個軟件關(guān)閉了再重啟運行?
方法二(試試)
vue : 無法加載文件 D:\軟件安裝\nodejs\node_global\vue.ps1,因為在此系統(tǒng)上禁止運行腳本。(解決辦法)_云邊的快樂貓的博客-CSDN博客
方法三(換終端)
????????在把vscode軟件關(guān)閉,重新用管理員啟動后,發(fā)現(xiàn)輸入npm命令,程序還是沒有反應(yīng),就試試切換終端,終于成功了。默認是使用powershell終端,切換成Command Prompt再去執(zhí)行就好了?
方法四(終極必殺)?
去到C盤的自己賬戶的下面,點擊顯示隱藏的文件,找到.npmrc這個文件然后刪掉他。
如果用這個方法,那么自己配置的默認依賴下載到其他盤就失效了,就像剛開始那樣,依賴都是會下載到C盤了。這個也能解決輸入npm命令沒有反應(yīng)的問題。
四、解決成功截圖
五、相似的錯誤參考
因為沒有cd切換到對應(yīng)的子目錄造成的錯誤,下文就是教cd切換到子目錄下面執(zhí)行的文章?
解決啟動vue前端報錯:npm ERR! Missing script: “serve“_云邊的快樂貓的博客-CSDN博客?
有什么問題都可以評論區(qū)留言,看見都會回復(fù)的
如果你覺得本篇文章對你有所幫助的,多多支持吧?。?!文章來源:http://www.zghlxwxcb.cn/news/detail-829971.html
點贊收藏評論,當(dāng)然也可以點擊文章底部的紅包或者??訂閱付費文章創(chuàng)作支持一下了。抱拳了!文章來源地址http://www.zghlxwxcb.cn/news/detail-829971.html
到了這里,關(guān)于解決:npm ERR! code EPERMnpm ERR! syscall opennpm ERR! path D:\node18\node_cache\_cacache\tmp\71-4048錯誤的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!