npm ERR! notarget No matching version found for xxx@^1.0.64. npm 插件安装失败解决

_

问题

今天使用npm install安装项目依赖的时候报错:npm ERR! notarget No matching version found for xxx@^1.0.64. npm

npm ERR! code ETARGET
npm ERR! notarget No matching version found for xxx@^1.0.64.
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.

解释:在安装某插件过程中查找不到此插件的这个版本号

原因

1、可能是您当初设置的镜像源为淘宝镜像源 npm https://registry.npm.taobao.org
2、然而淘宝镜像源没有及时更新此插件版本,从而引起插件安装错误

解决办法

1、检测当前镜像源

npm config get registry

2、修改镜像源为npm

npm config set registry https://registry.npmjs.org

3、尝试重新下载插件,此时您应该可以下载插件了

4、完成下载后便可切换镜像源至淘宝镜像源

npm config set registry https://registry.npm.taobao.org

Vue的beforeRouteEnter如何使用组件实例的方法 2023-02-19
nodejs记录:liunx服务器使用dev运行项目出现node:events:491错误的解决办法 2023-04-21