calxibe / StorjMonitor

Node.js script for publishing data from local Storj nodes to Storjstat.com
15 stars 14 forks source link

Unable to run on Raspberry Pi #6

Closed venanx closed 6 years ago

venanx commented 6 years ago

Receiving the error :

/home/pi/StorjMonitor-master/storjMonitor.js:6 const dnode = require('dnode'); ^^^^^ SyntaxError: Use of const in strict mode. at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3

MrTechGadget commented 6 years ago

Considering that storjshare is not supported on the Pi, I don't think this is an issue.

On Feb 14, 2018 11:12 PM, "Andre Venancio" notifications@github.com wrote:

Receiving the error :

/home/pi/StorjMonitor-master/storjMonitor.js:6 const dnode = require('dnode'); ^^^^^ SyntaxError: Use of const in strict mode. at Module._compile (module.js:439:25) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Function.Module.runMain (module.js:497:10) at startup (node.js:119:16) at node.js:906:3

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/calxibe/StorjMonitor/issues/6, or mute the thread https://github.com/notifications/unsubscribe-auth/AQVLdeQLLKrE6kLGOgzTjswE-47ODzaCks5tU66XgaJpZM4SGUQ_ .

fbitti commented 6 years ago

https://docs.storj.io/v1.1/docs/setting-up-storj-share-on-a-raspberry-pi

calxibe commented 6 years ago

I don't have much experience with Rasbian myself, but the only file you actually need to run the monitor is storjMonitor.js. You could try to install the dependencies manually and see if you get it up and running.

According to your error log above the Rasbian have a problem with two of the following:

MrTechGadget commented 6 years ago

please consider buying the Pine Rock64 4GB RAM board here https://www.pine64.org/?product=rock64-media-board-computer instead (all steps in this guide are still valid),

On Thu, Feb 15, 2018 at 8:27 AM Fernando Bitti Loureiro < notifications@github.com> wrote:

Yes, it is: https://docs.storj.io/v1.1/docs/setting-up-storj-share-on-a-raspberry-pi

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/calxibe/StorjMonitor/issues/6#issuecomment-365926788, or mute the thread https://github.com/notifications/unsubscribe-auth/AQVLdfFbeUnZDlNhAsKcYrKcqsxEDSWKks5tVDDRgaJpZM4SGUQ_ .

ivnmad commented 6 years ago

When I try to run storjMonitor.sh on Raspberry Pi, I get the following error message

/StorjMonitor-master/node_modules/bindings/bindings.js:83 throw e ^

Error: /StorjMonitor-master/node_modules/weak/build/Release/weakref.node: invalid ELF header at Error (native) at Object.Module._extensions..node (module.js:434:18) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12) at Module.require (module.js:353:17) at require (internal/module.js:12:17) at bindings (/StorjMonitor-master/node_modules/bindings/bindings.js:76:44) at Object. (/StorjMonitor-master/node_modules/weak/lib/weak.js:7:35) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10)

ivnmad commented 6 years ago

If I try to run storjMonitor.js, I get the following error message:

File "storjMonitor.js", line 6 const dnode = require('dnode'); ^ SyntaxError: invalid syntax

MrTechGadget commented 6 years ago

What happens if you try changing const to var? On Fri, Feb 16, 2018 at 11:22 AM Ivan V. notifications@github.com wrote:

If I try to run storjMonitor.js, I get the following error message:

File "storjMonitor.js", line 6

const dnode = require('dnode'); ^

SyntaxError: invalid syntax

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/calxibe/StorjMonitor/issues/6#issuecomment-366283074, or mute the thread https://github.com/notifications/unsubscribe-auth/AQVLdTg9mH3GJBbeiu4UHDfTuhVymaC2ks5tVasqgaJpZM4SGUQ_ .

ivnmad commented 6 years ago

Same error message:

File "storjMonitor.js", line 6 var dnode = require('dnode'); ^ SyntaxError: invalid syntax

0xBEAKER commented 6 years ago

I'm having the same issue as @ivnmad

MrTechGadget commented 6 years ago

Hmm, I don’t know what syntax error that could be..

What version of node? node —version On Fri, Feb 16, 2018 at 11:52 AM Paul Beach notifications@github.com wrote:

I'm having the same issue as @ivnmad https://github.com/ivnmad

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/calxibe/StorjMonitor/issues/6#issuecomment-366292287, or mute the thread https://github.com/notifications/unsubscribe-auth/AQVLddHlmvoYpen1MFf9PtfNIG84vZUYks5tVbJAgaJpZM4SGUQ_ .

ivnmad commented 6 years ago

pi@RaspberryPi:~ $ node -v v8.9.4

stefanbenten commented 6 years ago

You need to recompile the preconfigured node_modules. Then it should run without issues @ivnmad , @venanx

ivnmad commented 6 years ago

Might need help with this.. I tried to run "npm rebuild node_modules/" and it seem to be successful, but if I then try to run ./storjMonitor.sh I get the same identical error message..

stefanbenten commented 6 years ago

@ivnmad Did you check out the new storjMonitor-install.sh? This method should work.

ivnmad commented 6 years ago

@stefanbenten making progress.. I followed the instructions, and the installation worked, but..

If I try to run storjMonitor.sh it hangs here (correct API-Key, reporting correct node that I'm deleting):

[14:02:41] xxxxx | Submit to Storjstat [14:02:41] ERROR {"error":"Invalid farmer data (spaceUsedBytes)"}

Any suggestions?

stefanbenten commented 6 years ago

@ivnmad Take a look at this issue, its an error when your storjshare status output doesnt report the used Space correctly: #7

Your Monitor is working correctly at this point. I will work on a solution for the above mentioned error 👍