But it always fails in a forest of errors such as “cannot find blynk-library” “unexpected token”
A note to say Don’t forget to set the NODE_PATH variable is not helpful. An example of how to set the path would be so much better and would help newbies enormously.
Thanks for this. I tried it but now I get another mysterious error:
pi@raspberrypi ~/wiringPi $ node blynk-test.js
/home/pi/wiringPi/blynk-test.js:1
(function (exports, require, module, __filename, __dirname) { export NODE_PATH
^^^^^^
SyntaxError: Unexpected reserved word
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions…js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
It looks like you make a mistake in the script.
But I can’t tell anything unless you post your code.
Probably NODE_PATH should be set in console , not inside of the Node.js script.
node blynk-test.js
/home/pi/wiringPi/blynk-test.js:1
(function (exports, require, module, __filename, __dirname) { export NODE_PATH
^^^^^^
SyntaxError: Unexpected reserved word
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions…js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3