node -- npm无法安装各种包解决方法

来源:互联网 发布:行知学院 编辑:程序博客网 时间:2024/05/17 07:04

在使用npm安装组件包时;会遇到无法安装各种包,错误如下:
这里写图片描述

解决方案:

1: 执行一下两条命令,查看返回值是否为null;

npm config get proxynpm config get https-proxy

2:如果不为null,将这两个参数值设置为null

npm config set proxy nullnpm config set https-proxy null

3: 继续

npm config set registry http://registry.cnpmjs.org/
0 0