jensrossbach / node-red-contrib-sony-audio

Node-RED nodes for accessing Sony Audio Control API
MIT License
2 stars 0 forks source link

Unable to install from Palette #26

Closed mrginogit closed 3 years ago

mrginogit commented 3 years ago

Hi,

I am running Node-RED 7.2.10 within Home Assistant on a Raspberry Pi 3b and getting the below error whenever I try to install this node. Other nodes install fine so I am thinking this is a dependency issue. I tried listing node-red-contrib-sony-audio's dependencies (node-fetch, websocket, node-ssdp, xml-js) in Node-RED's configuration under "npm_packages" but got the same error. Is there a specific version of websocket/bufferutil that I should be using?

-----------------------------------------------------------
2020-11-18T23:56:45.791Z Install : node-red-contrib-sony-audio 1.6.4

2020-11-18T23:56:49.342Z npm install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production node-red-contrib-sony-audio@1.6.4
2020-11-18T23:57:22.137Z [out] 
2020-11-18T23:57:22.137Z [out] > bufferutil@4.0.2 install /config/node-red/node_modules/bufferutil
2020-11-18T23:57:22.137Z [out] > node-gyp-build
2020-11-18T23:57:22.137Z [out] 
2020-11-18T23:57:33.956Z [out] make: Entering directory '/config/node-red/node_modules/bufferutil/build'
2020-11-18T23:57:33.958Z [out]   CC(target) Release/obj.target/bufferutil/src/bufferutil.o
2020-11-18T23:57:34.768Z [err] ../src/bufferutil.c:2:10: fatal error: assert.h: No such file or directory
2020-11-18T23:57:34.768Z [err]     2 | #include <assert.h>
2020-11-18T23:57:34.768Z [err]       |          ^~~~~~~~~~
2020-11-18T23:57:34.768Z [err] compilation terminated.
2020-11-18T23:57:34.800Z [err] make: *** [bufferutil.target.mk:105: Release/obj.target/bufferutil/src/bufferutil.o] Error 1
2020-11-18T23:57:34.802Z [out] make: Leaving directory '/config/node-red/node_modules/bufferutil/build'
2020-11-18T23:57:34.819Z [err] gyp 
2020-11-18T23:57:34.820Z [err] ERR! build error 
2020-11-18T23:57:34.823Z [err] gyp
2020-11-18T23:57:34.823Z [err]  ERR! stack
2020-11-18T23:57:34.824Z [err]  Error: `make` failed with exit code: 2
2020-11-18T23:57:34.824Z [err] gyp ERR! stack     at ChildProcess.onExit (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:194:23)
2020-11-18T23:57:34.824Z [err] gyp 
2020-11-18T23:57:34.825Z [err] ERR! stack     at ChildProcess.emit (events.js:315:20)
2020-11-18T23:57:34.825Z [err] gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
2020-11-18T23:57:34.826Z [err] gyp
2020-11-18T23:57:34.827Z [err]  ERR! System Linux 4.19.127-v8
2020-11-18T23:57:34.827Z [err] gyp
2020-11-18T23:57:34.828Z [err]  ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
2020-11-18T23:57:34.828Z [err] gyp ERR! 
2020-11-18T23:57:34.829Z [err] cwd /config/node-red/node_modules/bufferutil
2020-11-18T23:57:34.829Z [err] gyp ERR! node -v v12.18.4
2020-11-18T23:57:34.829Z [err] gyp ERR! 
2020-11-18T23:57:34.829Z [err] node-gyp -v v5.1.0
2020-11-18T23:57:34.829Z [err] gyp ERR! not ok 
2020-11-18T23:57:36.028Z [err] npm
2020-11-18T23:57:36.029Z [err]  ERR! code ELIFECYCLE
2020-11-18T23:57:36.029Z [err] npm
2020-11-18T23:57:36.030Z [err]  ERR! errno 1
2020-11-18T23:57:36.045Z [err] npm 
2020-11-18T23:57:36.046Z [err] ERR! bufferutil@4.0.2 install: `node-gyp-build`
2020-11-18T23:57:36.046Z [err] npm ERR! Exit status 1
2020-11-18T23:57:36.046Z [err] npm 
2020-11-18T23:57:36.046Z [err] ERR! 
2020-11-18T23:57:36.046Z [err] npm ERR! Failed at the bufferutil@4.0.2 install script.
2020-11-18T23:57:36.046Z [err] npm
2020-11-18T23:57:36.046Z [err]  ERR! This is probably not a problem with npm. There is likely additional logging output above.
jensrossbach commented 3 years ago

Hi,

node-red-contrib-sony-audio does not require bufferutil directly, it seems the dependency to bufferutil comes from websocket. You can see the minimum versions of the required node packages by looking into package.json file.

I don't know what is version 7.2.10 of Node-RED, from my knowledge, the latest version is 1.2.5.

mrginogit commented 3 years ago

Thanks for the response. 7.2.10 is actually the version of the Node-RED addon within Home Assistant: https://github.com/hassio-addons/addon-node-red. Sorry for the confusion there.

Have you used your custom node on ARM-based platforms like the raspberry pi?

jensrossbach commented 3 years ago

Yes, I'm using the nodes also on a Raspberry Pi 4 without problems (but in context of a stand-alone Node-RED, not as plugin for Home Assistant).

jensrossbach commented 3 years ago

Maybe you can try this: sudo apt-get install build-essential

Then try again to install the node package.

jensrossbach commented 3 years ago

@mrginogit was your issue solved meanwhile? Can I close this ticket?

mrginogit commented 3 years ago

Thanks for following up, sorry I forgot to close the loop here. I posted on the Home Assistant forum's Node-RED add-on thread after you commented here. Others also reported the same issue, but no response from the devs. Reference for others finding this issue: https://community.home-assistant.io/t/home-assistant-community-add-on-node-red/55023/933?u=mrg192fq3

I ended up just giving up on your nodes and built the integration myself using the websocket and http request nodes. So while this issue is unresolved, I'll close it since I found an alternative. Thanks!