node-red-contrib-python-function icon indicating copy to clipboard operation
node-red-contrib-python-function copied to clipboard

Loading fails on Raspberry Pi

Open pierbiag opened this issue 9 years ago • 2 comments

after installing the node through npm, when I start node-RED on my raspberry pi zero i can read these lines and the node won't appear.

pi : TTY=unknown ; PWD=/ ; USER=root ; COMMAND=/usr/bin/python -u /usr/lib/node_modules/node-red/nodes/core/hardware/nrgpio.py info
pam_unix(sudo:session): session opened for user root by (uid=0)
pam_unix(sudo:session): session closed for user root
/usr/lib/node_modules/node-red-contrib-python-function/lib/python-function.js:6
return fnCode.split('\n').map((line) => Array(depth).join(' ') + line).joi
^
18 Aug 16:54:56 - [warn] ------------------------------------------
18 Aug 16:54:56 - [warn] Failed to register 1 node type
18 Aug 16:54:57 - [warn] Run with -v for details
18 Aug 16:54:57 - [warn] ------------------------------------------

pierbiag avatar Aug 18 '16 17:08 pierbiag

Thanks for reporting. Can you provide which version of node-RED and Node.js are being used?

arnauorriols avatar Aug 19 '16 09:08 arnauorriols

ok, I think i solved it by updating Node.js from the default 0.12.something to 4.5.0. However on the RasPi 0 (ARM6) the repositories to update it don't work, and it must be done manually using the binaries.

I know it shouldn't be a problem for the average user, but it was a bit painful for me as a nearly absolute Noob! ;)

From what i understood the main problem should be the use of arrow functions (according to jshint.com).

Also, another question: how do I access the context from within the python function node?

pierbiag avatar Aug 19 '16 10:08 pierbiag