# Tsl2561 luminosity node

**URL:** https://discourse.nodered.org/t/tsl2561-luminosity-node/29350
**Category:** General
**Created:** [2 July 2020 05:50 UTC](https://discourse.nodered.org/t/tsl2561-luminosity-node/29350 "2020-07-02T05:50:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![rmystique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rmystique/32/84365_2.png) [@rmystique](https://discourse.nodered.org/u/rmystique)
#### Post date: [2 July 2020 05:50 UTC](https://discourse.nodered.org/t/tsl2561-luminosity-node/29350/1 "2020-07-02T05:50:18Z")

</div>

I can't get the node ( node-red-contrib-tsl2561) for this to install, it has lots of errors, Im trying to use the lux sensor and get a value returned, maybe another way to do it?

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [2 July 2020 06:04 UTC](https://discourse.nodered.org/t/tsl2561-luminosity-node/29350/2 "2020-07-02T06:04:34Z")

</div>

Show us the errors when you try to install it from the command line, go to your .node-red folder and run  
`npm install node-red-contrib-....`  
And copy/paste the full output here.

---

<div class="post-metadata">

### Author: ![rmystique](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/rmystique/32/84365_2.png) [@rmystique](https://discourse.nodered.org/u/rmystique)
#### Post date: [2 July 2020 06:57 UTC](https://discourse.nodered.org/t/tsl2561-luminosity-node/29350/3 "2020-07-02T06:57:33Z")

</div>

2020-07-02T06:55:48.975Z Install : node-red-contrib-tsl2561 0.1.1

2020-07-02T06:55:49.454Z npm install --no-audit --no-update-notifier --save --save-prefix="~" --production node-red-contrib-tsl2561@0.1.1  
2020-07-02T06:56:05.244Z [out]  
2020-07-02T06:56:05.244Z [out] \> tsl2561@0.0.1 install /home/pi/.node-red/node\_modules/tsl2561  
2020-07-02T06:56:05.244Z [out] \> node-gyp rebuild  
2020-07-02T06:56:05.244Z [out]  
2020-07-02T06:56:09.490Z [out] make: Entering directory '/home/pi/.node-red/node\_modules/tsl2561/build'  
2020-07-02T06:56:09.490Z [out] CXX(target) Release/obj.target/tsl2561/src/tsl2561.o  
2020-07-02T06:56:13.016Z [err] In file included from ../src/tsl2561.cc:2:  
2020-07-02T06:56:13.016Z [err] ../src/tsl2561.h:29:41: error: expected class-name before ‘{’ token  
2020-07-02T06:56:13.016Z [err] class Tsl2561 : public node::ObjectWrap {  
2020-07-02T06:56:13.016Z [err] ^  
2020-07-02T06:56:13.016Z [err] ../src/tsl2561.h:31:24: error: ‘v8::Handle’ has not been declared  
2020-07-02T06:56:13.016Z [err] static void Init(v8::Handlev8::Object exports);  
2020-07-02T06:56:13.016Z [err] ^ ~~~~~  
2020-07-02T06:56:13.016Z [err] ../src/tsl2561.h:31:30: error: expected ‘,’ or ‘...’ before ‘\<’ token  
2020-07-02T06:56:13.016Z [err] static void Init(v8::Handlev8::Object exports);  
2020-07-02T06:56:13.016Z [err] ^  
2020-07-02T06:56:13.016Z [err] ../src/tsl2561.h:37:14: error: ‘Handle’ in namespace ‘v8’ does not name a template type  
2020-07-02T06:56:13.016Z [err] static v8::Handlev8::Value New(const v8::Arguments& args);  
2020-07-02T06:56:13.016Z [err] ^ ~~~~~  
2020-07-02T06:56:13.016Z [err] ../src/tsl2561.h:38:14: error: ‘Handle’ in namespace ‘v8’ does not name a template type  
2020-07-02T06:56:13.016Z [err] static v8::Handlev8::Value Lux(const v8::Arguments& args);  
2020-07-02T06:56:13.016Z [err] ^ ~~~~~  
2020-07-02T06:56:13.016Z [err] ../src/tsl2561.h:39:14: error: ‘Handle’ in namespace ‘v8’ does not name a template type  
2020-07-02T06:56:13.016Z [err] static v8::Handlev8::Value Id(const v8::Arguments& args);  
2020-07-02T06:56:13.016Z [err] ^ ~~~~~  
2020-07-02T06:56:13.016Z [err] ../src/tsl2561.cc:6:14: error: variable or field ‘InitAll’ declared void  
2020-07-02T06:56:13.016Z [err] void InitAll(Handle exports) {  
2020-07-02T06:56:13.016Z [err] ^ ~~~~~  
2020-07-02T06:56:13.018Z [err] ../src/tsl2561.cc:6:14: error: ‘Handle’ was not declared in this scope  
2020-07-02T06:56:13.026Z [err] ../src/tsl2561.cc:6:14: note: suggested alternative: ‘rand\_r’  
2020-07-02T06:56:13.026Z [err] void InitAll(Handle exports) {  
2020-07-02T06:56:13.026Z [err] ^ ~~~~~  
2020-07-02T06:56:13.026Z [err] rand\_r  
2020-07-02T06:56:13.027Z [err] ../src/tsl2561.cc:6:27: error: expected primary-expression before ‘\>’ token  
2020-07-02T06:56:13.027Z [err] void InitAll(Handle exports) {  
2020-07-02T06:56:13.027Z [err] ^  
2020-07-02T06:56:13.027Z [err] ../src/tsl2561.cc:6:29: error: ‘exports’ was not declared in this scope  
2020-07-02T06:56:13.027Z [err] void InitAll(Handle exports) {  
2020-07-02T06:56:13.027Z [err] ^ ~~~~~~  
2020-07-02T06:56:13.038Z [err] In file included from ../src/tsl2561.cc:1:  
2020-07-02T06:56:13.038Z [err] ../src/tsl2561.cc:10:22: error: ‘InitAll’ was not declared in this scope  
2020-07-02T06:56:13.038Z [err] NODE\_MODULE(tsl2561, InitAll)  
2020-07-02T06:56:13.038Z [err] ^ ~~~~~~  
2020-07-02T06:56:13.038Z [err] /home/pi/.cache/node-gyp/12.18.1/include/node/node.h:608:36: note: in definition of macro ‘NODE\_MODULE\_X’  
2020-07-02T06:56:13.038Z [err] (node::addon\_register\_func) (regfunc),   
2020-07-02T06:56:13.038Z [err] ^ ~~~~~~  
2020-07-02T06:56:13.038Z [err] ../src/tsl2561.cc:10:1: note: in expansion of macro ‘NODE\_MODULE’  
2020-07-02T06:56:13.038Z [err] NODE\_MODULE(tsl2561, InitAll)  
2020-07-02T06:56:13.038Z [err] ^ ~~~~~~~~~~  
2020-07-02T06:56:13.520Z [err] make: \*\*\* [tsl2561.target.mk:108: Release/obj.target/tsl2561/src/tsl2561.o] Error 1  
2020-07-02T06:56:13.521Z [out] make: Leaving directory '/home/pi/.node-red/node\_modules/tsl2561/build'  
2020-07-02T06:56:13.528Z [err] gyp  
2020-07-02T06:56:13.529Z [err]  
2020-07-02T06:56:13.530Z [err] ERR! build error  
2020-07-02T06:56:13.533Z [err] gyp  
2020-07-02T06:56:13.534Z [err] ERR! stack  
2020-07-02T06:56:13.534Z [err] Error: `make` failed with exit code: 2  
2020-07-02T06:56:13.534Z [err] gyp ERR!  
2020-07-02T06:56:13.535Z [err] stack  
2020-07-02T06:56:13.535Z [err] at ChildProcess.onExit (/usr/lib/node\_modules/npm/node\_modules/node-gyp/lib/build.js:194:23)  
2020-07-02T06:56:13.535Z [err] gyp  
2020-07-02T06:56:13.535Z [err] ERR! stack  
2020-07-02T06:56:13.535Z [err] at ChildProcess.emit (events.js:315:20)  
2020-07-02T06:56:13.535Z [err] gyp  
2020-07-02T06:56:13.536Z [err] ERR! stack  
2020-07-02T06:56:13.536Z [err] at Process.ChildProcess.\_handle.onexit (internal/child\_process.js:275:12)  
2020-07-02T06:56:13.537Z [err] gyp  
2020-07-02T06:56:13.538Z [err] ERR! System Linux 4.19.118-v7+  
2020-07-02T06:56:13.538Z [err] gyp  
2020-07-02T06:56:13.538Z [err] ERR!  
2020-07-02T06:56:13.539Z [err] command "/usr/bin/node" "/usr/lib/node\_modules/npm/node\_modules/node-gyp/bin/node-gyp.js" "rebuild"  
2020-07-02T06:56:13.539Z [err] gyp ERR!  
2020-07-02T06:56:13.539Z [err] cwd /home/pi/.node-red/node\_modules/tsl2561  
2020-07-02T06:56:13.540Z [err] gyp ERR!  
2020-07-02T06:56:13.540Z [err] node -v v12.18.1  
2020-07-02T06:56:13.540Z [err] gyp ERR!  
2020-07-02T06:56:13.541Z [err] node-gyp -v v5.1.0  
2020-07-02T06:56:13.541Z [err] gyp ERR! not ok  
2020-07-02T06:56:16.085Z [err] npm WARN node-red-contrib-ui-led@0.3.1 requires a peer of node-red-dashboard@2.14.x but none is installed. You must install peer dependencies yourself.  
2020-07-02T06:56:16.085Z [err] npm WARN node-red-project@0.0.1 No repository field.  
2020-07-02T06:56:16.085Z [err] npm WARN node-red-project@0.0.1 No license field.  
2020-07-02T06:56:16.085Z [err]  
2020-07-02T06:56:16.085Z [err] npm ERR! code ELIFECYCLE  
2020-07-02T06:56:16.085Z [err] npm ERR! errno 1  
2020-07-02T06:56:16.085Z [err] npm ERR! tsl2561@0.0.1 install: `node-gyp rebuild`  
2020-07-02T06:56:16.085Z [err] npm ERR! Exit status 1  
2020-07-02T06:56:16.085Z [err] npm ERR!  
2020-07-02T06:56:16.085Z [err] npm ERR! Failed at the tsl2561@0.0.1 install script.  
2020-07-02T06:56:16.085Z [err] npm ERR! This is probably not a problem with npm. There is likely additional logging output above.  
2020-07-02T06:56:16.085Z [err]  
2020-07-02T06:56:16.085Z [err] npm ERR! A complete log of this run can be found in:  
2020-07-02T06:56:16.085Z [err] npm ERR! /home/pi/.npm/\_logs/2020-07-02T06\_56\_14\_628Z-debug.log  
2020-07-02T06:56:16.090Z rc=1

---

<div class="post-metadata">

### Author: ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)
#### Post date: [2 July 2020 08:23 UTC](https://discourse.nodered.org/t/tsl2561-luminosity-node/29350/4 "2020-07-02T08:23:19Z")

</div>

When you see errors with things like `error: ‘v8::Handle’ ` that often means it is an issue with the version of nodejs. I see that you are using 12.x and I also note that the node has not been updated for nearly 5 years. That almost certainly means that it is not compatible with version 12. Unfortunately there is no link to a github repository from the node's page so you cannot take the normal course of adding an issue there.

However the problem itself appears to be in the module used by the contrib node, which is [https://github.com/sonnens/node-tsl2561](https://github.com/sonnens/node-tsl2561). It has not been updated in 6 years though. You could try submitting an issue against that and see what happens. Otherwise, unless you can fix it yourself, I suspect you will have to find a different solution.

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [31 August 2020 08:23 UTC](https://discourse.nodered.org/t/tsl2561-luminosity-node/29350/5 "2020-08-31T08:23:23Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
