[HPM] Error occurred while trying to proxy request /account/login/ from localhost:3000 to http://127

2023-05-16

[HPM] Error occurred while trying to proxy request /account/login/ from localhost:3000 to http://127.0.0.1:8000(ECONNREFUSED)(https://nodejs.org/api/errors.html#errors_common_system_errors)

这个问题主要是从端口3000映射到8000端口失败
在这里插入图片描述
首先查看npm错误日志,通过查看日志,参考文档

https://segmentfault.com/q/1010000041491241

在这里插入图片描述

缺少nvm依赖包,安装好依赖包之后重新启动 api 开发环境服务python manage.py runserver
在这里插入图片描述
发现代码报错,原因是centos自带的python环境是2.X版本的,而我部署的项目环境要求是3.X版本,于是就是更新python版本
在这里插入图片描述
升级后,yum报错,因为yum依赖于python2.X版本,修改配置文件usr/bin/yum 将python改成python2.7
在这里插入图片描述
使用python3启动api服务
在这里插入图片描述
但是127.0.0.1:3000映射到8000端口还是失败了
在这里插入图片描述
解决方法
查看防火墙规则iptables -nL
清空默认表Filter的所有规则iptables -F
在这里插入图片描述
在这里插入图片描述
之后就可以正常启动了,仅供参考

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

[HPM] Error occurred while trying to proxy request /account/login/ from localhost:3000 to http://127 的相关文章

随机推荐