Zequez / reddit-placebot

A bot that paints on Reddit /r/place. Works with multiple accounts, and can work with a remote target file for multiple people with the same objective.
MIT License
225 stars 78 forks source link

Error in Raspian Jesse #29

Closed yottalogical closed 7 years ago

yottalogical commented 7 years ago

When I "npm run start" on Raspbian Jesse (Debian for Raspberry Pi) I get an error. I checked how I configured it, and couldn't find an issue. It may just not work on Raspbian Jesse. Here's the command line readout:


pi@raspberrypi:~/reddit-placebot $ npm run start

> reddit-placebot@1.0.0 start /home/pi/reddit-placebot
> node run.js

/home/pi/reddit-placebot/run.js:24
for (let user in users) { if (!queues[user]) scheduleUser(user) }
         ^^^^
SyntaxError: Unexpected identifier
    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

npm ERR! reddit-placebot@1.0.0 start: `node run.js`
npm ERR! Exit status 8
npm ERR! 
npm ERR! Failed at the reddit-placebot@1.0.0 start script.
npm ERR! This is most likely a problem with the reddit-placebot package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node run.js
npm ERR! You can get their info via:
npm ERR!     npm owner ls reddit-placebot
npm ERR! There is likely additional logging output above.
npm ERR! System Linux 4.4.13+
npm ERR! command "/usr/bin/nodejs" "/usr/bin/npm" "run" "start"
npm ERR! cwd /home/pi/reddit-placebot
npm ERR! node -v v0.10.29
npm ERR! npm -v 1.4.21
npm ERR! code ELIFECYCLE
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/pi/reddit-placebot/npm-debug.log
npm ERR! not ok code 0
ghost commented 7 years ago

I have the same issue on regular old windows 10.

Zequez commented 7 years ago

Maybe it's an old version of node that doesn't support the let keyword? Try running it with node src/run.js --harmony. The latest version does this by default.

Lenni commented 7 years ago

Also be sure that you installed nodejs manually beforehand

jdstaerk commented 7 years ago

@yottalogical you're running an old version of nodejs. Try to update it: sudo curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash - (Notice the "-" at the end!) sudo apt-get install -y nodejs And try to run it again :)

yottalogical commented 7 years ago

@DDerTyp Thanks for the help, but it looks like I do have the most recent version. I did what you said anyway, but nothing new was installed. The problem didn't go away either.

yottalogical commented 7 years ago

@Lenni I did make sure NodeJS was up to date, but thanks for suggesting that. I (as well as nearly everyone) has been known to make silly mistakes like that.

Zequez commented 7 years ago

I mean, in the log you posted it says you're using v0.10.29, which is not the most recent version, it was released on 2014.

If you are certain you installed the 7.x version then you might have the PATH badly configured.

yottalogical commented 7 years ago

Reason for Errors: I didn't have the most recent version of NodeJS.

Reason I didn't have the most recent version: My hardware (original Raspberry Pi) was not supported. Whenever I tried to update it, it just installed the most recent supported version (v0.10.29).