npm鏡像源證書(shū)過(guò)期的問(wèn)題解決
Failed to check for updates 問(wèn)題
錯(cuò)誤描述如上
檢查完 node
,vue
,npm
的版本后都沒(méi)啥問(wèn)題,嘗試更新腳手架
使用指令
#npm腳手架更新
pnpm update -g @vue/cli
出現(xiàn)問(wèn)題如下:
ERR_PNPM_NO_PKG_MANIFEST
這個(gè)是報(bào)錯(cuò)類型編號(hào)
這個(gè)報(bào)錯(cuò)是沒(méi)有找到 package.json
的文件,我當(dāng)時(shí)沒(méi)仔細(xì)看,就嘗試重新安裝 pnpm
#pnpm更新安裝
npm install pnpm -g
出現(xiàn)報(bào)錯(cuò)
npm ERR! code CERT_HAS_EXPIRED
npm ERR! errno CERT_HAS_EXPIRED
npm ERR! request to https://registry.npm.taobao.org/pnpm failed, reason: certificate has expirednpm ERR! Log files were not written due to an error writing to the directory: D:\Nodejavascript\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
在這里已經(jīng)很明顯了,報(bào)錯(cuò)提示是 #reason:certificate_has_expired 就是說(shuō)目前我的鏡像網(wǎng)站證書(shū)過(guò)期了,連淘寶自己提供的鏡像源網(wǎng)站都不去管管證書(shū)的嘛??(來(lái)自我復(fù)盤(pán)的吐槽)
當(dāng)時(shí)認(rèn)為是不是自己的問(wèn)題,進(jìn)行 npm
緩存清除操作,
npm緩存清除指令
npm cache clean --force
出現(xiàn)第二個(gè)報(bào)錯(cuò)
PS D:\front-end\untitled2> npm cache clean --force
npm WARN using --force Recommended protections disabled.
npm ERR! code EPERM
npm ERR! syscall rmdir
npm ERR! path D:\Nodejavascript\node_cache\_cacache\tmp
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, rmdir 'D:\Nodejavascript\node_cache\_cacache\tmp'
npm ERR! errno: -4048,
npm ERR! code: 'EPERM',
npm ERR! syscall: 'rmdir',
npm ERR! path: 'D:\\Nodejavascript\\node_cache\\_cacache\\tmp'
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! 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:\Nodejavascript\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
其實(shí)這個(gè)也說(shuō)的很清楚,Error:EPERM:operation not permitted,rmdir ‘D:\Nodejavascript\node_cache\_cacache\tmp’
就是說(shuō)沒(méi)有權(quán)限刪除,這個(gè)問(wèn)題一般有幾種解決思路
權(quán)限不足導(dǎo)致刪除不了解決方案
- 如果是在C盤(pán)的文件遇到權(quán)限不足,建議移出C盤(pán),因?yàn)镃盤(pán)的權(quán)限是一個(gè)迷,很容易出現(xiàn)奇奇怪怪的權(quán)限問(wèn)題
- 如果是在其他盤(pán),直接開(kāi)管理員權(quán)限運(yùn)行就可以了
之后明白可能是證書(shū)和權(quán)限的問(wèn)題,就打算隨便執(zhí)行一下依賴更新操作,檢驗(yàn)一下是否可用
#npm依賴更新指令
npm install
然后給我直接報(bào)錯(cuò)了 #沒(méi)有package的Json文件報(bào)錯(cuò)
PS D:\front-end\untitled2> npm install
npm ERR! code ENOENT
npm ERR! syscall open
npm ERR! path D:\front-end\untitled2/package.json
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, open 'D:\front-end\untitled2\package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoentnpm ERR! Log files were not written due to an error writing to the directory: D:\Nodejavascript\node_cache\_logs
npm ERR! You can rerun the command with `--loglevel=verbose` to see the logs in your terminal
Wrote to D:\front-end\untitled2\package.json:
npm創(chuàng)建基礎(chǔ)配資文件
npm init -y
這樣就默認(rèn)創(chuàng)建了一個(gè)簡(jiǎn)單的 package.json
文件
ok! 到此為止,就基本上將邊角問(wèn)題解決了,后續(xù)考慮解決問(wèn)題是否應(yīng)該切換一個(gè)數(shù)據(jù)源的問(wèn)題
#npm檢查設(shè)置遠(yuǎn)程倉(cāng)庫(kù)指令
npm config get registry
得到域名
https://npm.taobao.org
去網(wǎng)上搜,淘寶那個(gè)npm
改名了?。?!
https://npmmirror.com/
最新的是這個(gè),我真的心情復(fù)雜。
設(shè)置一下全局鏡像源配置就行了,最后完成目的的指令是
npm config set registry=https://npmmirror.com/
如果出現(xiàn)以下這種錯(cuò)誤,就是說(shuō)明鏡像源太落后了,不匹配
PS D:\front-end\untitled3> npm install
npm ERR! code ETARGET
npm ERR! notarget No matching version found for @vue/server-renderer@3.4.21.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in: D:\Nodejavascript\node_cache\_logs\2024-02-29T04_10_05_694Z-debug-0.log
PS D:\front-end\untitled3> npm config set
npm ERR! code EUSAGE
npm ERR!
主要從這幾句話可以看出 notarget No matching version found for @vue/server-renderer@3.4.21
這個(gè)是之前我換華為云的鏡像服務(wù)器之后出現(xiàn)的問(wèn)題,最后實(shí)在不行了,換回了 https://npmmirror.com/
這個(gè)域名
從此,解決 npm
無(wú)法使用問(wèn)題
到此這篇關(guān)于npm鏡像源證書(shū)過(guò)期的問(wèn)題解決的文章就介紹到這了,更多相關(guān)npm鏡像源證書(shū)過(guò)期內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!
相關(guān)文章
詳解node登錄接口之密碼錯(cuò)誤限制次數(shù)(含代碼)
這篇文章主要介紹了nodejs登錄接口之密碼錯(cuò)誤限制次數(shù)(含代碼),文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友們下面隨著小編來(lái)一起學(xué)習(xí)學(xué)習(xí)吧2019-10-10nodeJS代碼實(shí)現(xiàn)計(jì)算交社保是否合適
本文通過(guò)nodejs的一個(gè)具體示例來(lái)對(duì)比分析現(xiàn)階段我們交社保合不合適,主要是對(duì)nodejs的一個(gè)小的應(yīng)用,當(dāng)然大家也可以改成其他語(yǔ)言的,程序猿們,來(lái)算算吧。2015-03-03使用Redis和Node.js來(lái)開(kāi)發(fā)簡(jiǎn)單的實(shí)時(shí)聊天功能
在眾多實(shí)時(shí)通信的技術(shù)中,Redis和Node.js的結(jié)合是一種非常強(qiáng)大和流行的選擇,Redis是一種高性能的鍵值存儲(chǔ)數(shù)據(jù)庫(kù),而Node.js是一個(gè)基于事件驅(qū)動(dòng)的JavaScript運(yùn)行時(shí)環(huán)境,兩者的結(jié)合可以輕松實(shí)現(xiàn)實(shí)時(shí)聊天功能,本文將指導(dǎo)您使用Redis和Node.js來(lái)開(kāi)發(fā)一個(gè)簡(jiǎn)單的實(shí)時(shí)聊天功能2024-08-08NPM命令運(yùn)行報(bào)錯(cuò):npm?v10.2.4?is?known?not?to?run?on?Node.js
這篇文章主要給大家介紹了關(guān)于NPM命令運(yùn)行報(bào)錯(cuò):npm?v10.2.4?is?known?not?to?run?on?Node.js?v14.21.1的解決辦法,文中將解決辦法介紹的非常詳細(xì),需要的朋友可以參考下2024-01-01淺談Node.js爬蟲(chóng)之網(wǎng)頁(yè)請(qǐng)求模塊
本篇文章主要介紹了淺談Node.js爬蟲(chóng)之網(wǎng)頁(yè)請(qǐng)求模塊,小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,也給大家做個(gè)參考。一起跟隨小編過(guò)來(lái)看看吧2018-01-01