npm安装错误: No matching version found for [email protected]^4.6.13

npm安装错误: No matching version found for [email protected]^4.6.13

我在使用npm命令 npm i -S terser-webpack-plugin 安装 terser-webpack-plugin 时发成错误
npm安装错误: No matching version found for [email protected]^4.6.13
错误显示没有找到符合的[email protected]^4.6.13版本

根据这篇文章,我在npm的官网查找 terser 的版本
npm安装错误: No matching version found for [email protected]^4.6.13
结果是有这个版本的,根据上面链接中文章所讲,需要把npm的源切换成npm自己的源。
这个切换npm的源是什么意思呢,大部分使用npm的朋友都应该体验过npm的下载速度,为了提高下载速度都会将npm的下载源切换到国内的淘宝源:http://registry.npm.taobao.org 现在只需要将源再切换回官方源:http://registry.npmjs.org 就可以了。

具体的切换方法:npm config set registry URL
即:npm config set registry http://registry.npmjs.org
在查找资料的时候发现****上有一篇文章写的是:npm config set registry=http://registry.npmjs.org 我按照这个命令去执行的时候报错:npm: command not found 之后再次查询才找到正确的切换方式,在此记录一下,方便以后遇到相同情况时查阅。