1.删除项目目录下的node_modules文件夹
2. 执行 cnpm install 命令
3. 如果出现 Error: unable to verify the first certificate ,则表示不成功
4. 取消ssl验证:npm config set strict-ssl false

(2017年2月27日,npm不再支持自签名证书。npm install走的是https协议,需要通过数字证书来保证)

5.继续执行 cnpm install 或 npm install 命令
6.如果还不行,将npm源更换为国内镜像:

npm config set registry http://registry.npm.taobao.org/
Logo

前往低代码交流专区

更多推荐