在百度上查找了一點資料。如下:
npm install報 404 Not Found - GET https://registry.npmjs.org
一、先查看一下有沒有設置代理
npm config get proxy npm config get https-proxy
以上兩個命令如果返回null,那么就不需要執行以下命令清理
npm config set https-proxy null npm config set proxy null
二、重新設置
npm config set registry https://registry.npmjs.org/
我也是照着這個試了一下,然后好了后在試着用npm安裝包,
npm WARN old lockfile
npm WARN old lockfile The package-lock.json file was created with an old version of npm,
npm WARN old lockfile so supplemental metadata must be fetched from the registry.
npm WARN old lockfile
npm WARN old lockfile This is a one-time fix-up, please be patient...
npm WARN old lockfile
結果出現這個,我一想,以前用的是時候沒出現這個過,所以我就試了一下查看npm的版本,發現版本升級了,於是我又npm i npm@6 -g安裝回了以前的版本
這次截至本文發文為止,還沒有出現什么問題。
記於2021.6.27 0:53
今天npm安裝又出錯了,在補充一下查到的解決方法且成功的。
刪除c盤中的.vuerc文件, 在重新安裝的時候會提示你選擇安裝工具(npm或yarn)
Pick the package manager to use when installing dependencies: Yarn ---我依然選擇的yarn
最后成功創建了一個項目