You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

在树莓派Ubuntu 22.04.4上无法通过脚本安装Node-RED求助

问题根源与解决步骤

核心问题

你的系统配置了指向localhost:3128的HTTP代理,但代理服务未启动或配置错误,导致curl无法正常下载Node-RED的安装脚本,进而引发后续的脚本执行报错。

具体解决步骤

1. 验证代理配置

运行以下命令查看当前代理环境变量:

echo $http_proxy $https_proxy

如果输出包含http://localhost:3128或类似内容,确认代理配置存在。

2. 临时禁用代理测试

执行以下命令临时清除代理环境变量,再尝试下载脚本:

unset http_proxy https_proxy
curl -L https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered

如果能正常返回脚本内容,说明代理是问题的关键。

3. 处理代理配置

  • 无需代理的情况:
    检查以下配置文件,删除包含http_proxy/https_proxy的行:

    • ~/.bashrc
    • ~/.profile
    • /etc/environment
      保存后重启终端,或执行source ~/.bashrc使修改生效。
  • 需要代理的情况:
    确保代理服务(如squid)已启动,且端口3128正常监听:

    sudo systemctl start squid  # 根据你的代理服务调整命令
    netstat -tulpn | grep 3128
    

    若端口未监听,检查代理服务的配置文件是否正确。

4. 正确执行Node-RED安装

代理问题解决后,优先采用本地下载脚本再执行的方式(避免sudo管道权限问题):

curl -L https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered > install-nodered.sh
chmod +x install-nodered.sh
sudo ./install-nodered.sh

内容的提问来源于stack exchange,提问作者Marko

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.22 08:42:38