pepzwee / node-csgo-web-tradebot

Web based CS:GO trade bot. Similar to CSGOSell.
MIT License
147 stars 59 forks source link

Site initial setup SyntaxError: Unexpected token #165

Closed Tdwyd1 closed 4 years ago

Tdwyd1 commented 4 years ago

Site startup

Site will not come online

Setup site following steps here https://steamapis.com/projects/node-csgo-web-tradebot/

Other

  1. [Operating System]: Ubuntu 16.04.6 (LTS) x64
  2. [Node.js version]: node --version v6.17.1
  3. [How did you start the script]: pm2 start index.js -n "Tradebot"

Error Stack

First, when doing console-setup for sudo systemctl stop apache2 and sudo systemctl stop nginx I am getting the error Failed to stop apache2.service: Unit apache2.service not loaded. and Failed to stop nginx.service: Unit nginx.service not loaded. respectively.

I also needed to use an older version of pm2 since when doing npm i -g pm2 and then pm2 start index.js -n "Tradebot" console just says [PM2] Spawning PM2 daemon with pm2_home=/root/.pm2 and it will not start. Currently using npm install pm2@2.10.1 -g.

Ignoring the 'stop' errors, and using the older version on pm2. When I try to do pm2 start index.js status shows as 'online', then when checking the logs pm2 logs 0

0|index | /root/tradebot/node_modules/ws/lib/websocket.js:347 0|index | ...options 0|index | ^^^ 0|index | 0|index | SyntaxError: Unexpected token ... 0|index | at createScript (vm.js:56:10) 0|index | at Object.runInThisContext (vm.js:97:10) 0|index | at Module._compile (module.js:549:28) 0|index | at Object.Module._extensions..js (module.js:586:10) 0|index | at Module.load (module.js:494:32) 0|index | at tryModuleLoad (module.js:453:12) 0|index | at Function.Module._load (module.js:445:3) 0|index | at Module.require (module.js:504:17) 0|index | at require (internal/module.js:20:19) 0|index | at Object. (/root/tradebot/node_modules/ws/index.js:3:19)

Thanks for any help or suggestions!

gassman123 commented 4 years ago

Your Node Version is the issue here. You need to update to at least 8.6.0. I would recommend updating to the latest version though

Tdwyd1 commented 4 years ago

That solution worked thank you! Repeat: curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - then sudo apt-get install -y nodejs