首先,这个报错的意思是,下载的时候无法连接上 对应的地址。
可使用 cnpm config get registry 命令查看当前目录下的registry值是否正确。
PS F:\repository\web_hyzx> cnpm config get registry
https://registry.npm.taobao.org/
如果当前目录下registry值正确,但安装的时候仍然报相同错误,直接运行cmd命令,打开命令行
运行cnpm config get registry
查看安装目录下的registry值:
此处,本台电脑上cnpm的registry为公司的一个镜像,实际上并无作用。
那么,运行 cnpm config set registry https://registry.npm.taobao.org 命令,重新设置为淘宝镜像即可。
最后,运行 cnpm install 成功安装。