Tencent / feflow

🚀 A command line tool aims to improve front-end engineer workflow and standard, powered by TypeScript.
https://feflowjs.com/
Other
1.36k stars 231 forks source link

Windows无法feflow install安装插件 #235

Open ktangel opened 4 years ago

ktangel commented 4 years ago

问题情况

在Windows平台上使用时,全局中安装完feflow后,执行feflow install 安装脚手架generator-ivweb或builder-webpack4构建器,都出现了下载请求时的证书错误,在Liunx平台下无此问题,node>11.0.0

log:

11 verbose stack FetchError: request to https://registry.npm.taobao.org/builder-webpack4 failed, reason: Hostname/IP does not match certificate's altnames: Host: registry.npm.taobao.org. is not in the cert's altnames: DNS:img.ucdl.pp.uc.cn, DNS:iscsi.ucdl.pp.uc.cn, DNS:slient.ucdl.pp.uc.cn, DNS:alissl.ucdl.pp.uc.cn, DNS:cdn.osupdateservice.yunos.com, DNS:oss.ucdl.pp.uc.cn

问题原因

调用安装时的参数中加上了proxy后导致证书错误。。 造成这种问题的可能是初始化的时候设置完'registry: 'https://registry.npm.taobao.org'' 后还设置了proxy参数。或者npm中也设置了proxy;

尝试解决

根据npm的log发现应该是在调用npm把依赖包安装到/用户/.feflow/ 目录时使用的参数中有代理。去掉代理。 于是我去到了~/.feflow目录,然后打开命令行自己执行

npm install builder-webpack4 --color=always --save --registry=https://registry.npm.taobao.org --global-style --unsafe-perm

然后 feflow list查看安装上去了;

所以最终解决办法是检查feflow的config proxy 配置是否初始化的时候给设置了proxy代理,

打开用户目录下的feflow配置文件~/.feflow/.feflowrc.yml,然后删除掉proxy参数。

npm的话是npm config delete proxy;

cpselvis commented 4 years ago

参考下这个文档试试:https://github.com/Tencent/feflow/wiki/%E5%BF%AB%E9%80%9F%E4%B8%8A%E6%89%8B