一、問題描述
學(xué)習(xí)vue數(shù)字大屏加載動(dòng)漫效果時(shí),在項(xiàng)目終端頁面輸入全局下載指令
npm install -g json-server
問題1、報(bào)--4048錯(cuò)誤
會(huì)報(bào)如下錯(cuò)誤?operation not permitted......errno: -4048code:'EPERM'syscall: 'mkdir'......The operation was reiected by your operating systemIt's possible that the file was already in use (by a text editor or antivirus).on that vou lack permissions to access it.
問題2、報(bào)ERR_SOCKET_TIMEOUT錯(cuò)誤
...This is a problem related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network?
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly. ?See: 'npm help config'...
二、解決步驟
一開始以為是權(quán)限問題,本人根據(jù)提示路徑找到node_modules文件,將文件權(quán)限勾選完全控制
但問題仍然存在?。?!
1、解決報(bào)--4048錯(cuò)誤問題方法參考鏈接1的評(píng)論區(qū):
1)找到 C:\Users\{賬戶}\下的.npmrc 文件,刪除.npmrc 文件
2)輸入npm cache clean --force?指令清除npm緩存:
npm cache clean --force
在使用npm cache clean --force 指令, 若反饋錯(cuò)誤,可能是版本過高,可以輸入:
npm cache verify
本人在剛剛刪除.npmrc的目錄下空白地方打開終端, 輸入npm cache verify指令通過了:
2、解決報(bào)ERR_SOCKET_TIMEOUT錯(cuò)誤問題參考鏈接2
經(jīng)過以上步驟,當(dāng)本人再次在項(xiàng)目終端頁面輸入全局下載指令時(shí),會(huì)卡在idealTree: timing idealTree Completed in 32944ms不動(dòng),最終報(bào)以下錯(cuò)誤:
解決方法參考鏈接2的評(píng)論區(qū):
換淘寶鏡像源npm config set registry
當(dāng)本人再再次輸入全局下載指令時(shí),通過了!
npm config set registry
感謝鏈接這兩篇文章,同時(shí)感謝評(píng)論區(qū)的大佬?。?!
三、參考鏈接
1、npm-install 命令報(bào)錯(cuò) -4048解決方案https://blog.csdn.net/weixin_44129867/article/details/126508964文章來源:http://www.zghlxwxcb.cn/news/detail-829968.html
2、npm install 卡在idealTree: timing idealTree Completed in 32944ms不動(dòng)https://blog.csdn.net/weixin_48071078/article/details/132095789文章來源地址http://www.zghlxwxcb.cn/news/detail-829968.html
到了這里,關(guān)于npm install報(bào)--4048錯(cuò)誤和ERR_SOCKET_TIMEOUT問題解決方法之一的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!