发表于 2022-11-11 21:48:10

解决node-red-contrib-home-assistant-websocket节点安装出错问题

用docker方式安装的node-red,一直装不了node-red-contrib-home-assistant-websocket 0.46.2,提示如下错误:

2022-11-11T12:47:21.281Z 安装 : node-red-contrib-home-assistant-websocket 0.46.2

2022-11-11T12:47:21.489Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
2022-11-11T12:47:32.085Z npm
2022-11-11T12:47:32.086Z notice created a lockfile as package-lock.json. You should commit this file.
2022-11-11T12:47:32.091Z npm
2022-11-11T12:47:32.091Z WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.3.2 (node_modules/chokidar/node_modules/fsevents):
2022-11-11T12:47:32.091Z npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
2022-11-11T12:47:32.091Z
2022-11-11T12:47:32.093Z + [email protected]
2022-11-11T12:47:32.093Z added 236 packages from 336 contributors in 10.245s
2022-11-11T12:47:32.106Z rc=0

看意思是fsevents这个依赖装不上,然而linux并不需要这个依赖,据说是npm 8的一个bug。。。

试了N遍终于找到解决办法,记录如下:

#进入docker容器
docker exec -it nodered /bin/bash

#设置腾讯源(这步很关键,貌似阿里源就不行)
npm config set registry http://mirrors.cloud.tencent.com/npm/

#强制安装fsevents
npm i -f [email protected]

#手动安装[email protected]
npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]

#修复一下
npm audit fix -f

#退出容器
exit

#重启容器,搞掂!
docker restart nodered
如图:




245621375 发表于 2022-11-11 21:59:08

沙发

情非殇 发表于 2022-11-11 22:02:08

docker默认源安装nr和websocket,升级0.46.2没遇到任何幺蛾子:lol

xuyang 发表于 2022-11-12 04:37:38

按照你的操作,还是升级不了

npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict [email protected]
npm ERR! code ENOTSUP
npm ERR! notsup Unsupported engine for [email protected]: wanted: {"node":">=14.0.0"} (current: {"node":"10.24.1","npm":"6.14.12"})
npm ERR! notsup Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Not compatible with your version of node/npm: [email protected]
npm ERR! notsup Required: {"node":">=14.0.0"}
npm ERR! notsup Actual:   {"npm":"6.14.12","node":"10.24.1"}

npm ERR! A complete log of this run can be found in:
npm ERR!   /root/.npm/_logs/2022-11-11T20_37_17_510Z-debug.log

admin 发表于 2022-11-12 22:31:32

xuyang 发表于 2022-11-12 04:37
按照你的操作,还是升级不了

npm install --no-audit --no-update-notifier --no-fund --save --save-pref ...

你npm版本不对,我是8,你是6,6不需要我这样操作,直接npm install那句就行

trz0332 发表于 2022-11-15 11:25:16

楼主请教个问题,我用docker安装的nodered有时候抽风,出现大量的连接hass,然后断开hass的日志,导致cpu 的load能飙到40多去,系统一下就卡死了。
重启nodered就正常了。
现在只能再hass里面做个策略。load升到4的时候马上重启nodered,但是感觉没找到根本原因,很憋火

发表于 2022-11-15 11:28:15

trz0332 发表于 2022-11-15 11:25
楼主请教个问题,我用docker安装的nodered有时候抽风,出现大量的连接hass,然后断开hass的日志,导致cpu...

这个还真没遇到过,可以看看node-red的日志?或npm的日志?这个俺是真不太懂,楼下大神上!

cnbb 发表于 2022-11-16 14:53:08

同样是docker部署的环境,HA里装了nodered插件,但打开的流一直提示Attention: This node requires Node-RED custom integration version 1.1.0+to be installed in Home Assistant for it to function.
应该如何解决呢?插件版本已尝试重新安装最新的1.1.2版本,然后重启HA和noedred的容器~~还是报上面的错误

yc0209 发表于 2022-11-20 06:42:33

cnbb 发表于 2022-11-16 14:53
同样是docker部署的环境,HA里装了nodered插件,但打开的流一直提示Attention: This node requires Node-RE ...

我也是同一样的问题,请问解决没

yc0209 发表于 2022-11-20 18:57:20

yc0209 发表于 2022-11-20 06:42
我也是同一样的问题,请问解决没

已解决了
页: [1] 2
查看完整版本: 解决node-red-contrib-home-assistant-websocket节点安装出错问题