carcabot / tiktok-signature

Generate tiktok signature token using node
735 stars 287 forks source link

Unexpected token at index.js:9 #15

Closed mathigatti closed 4 years ago

mathigatti commented 4 years ago

Hi! First of all thanks for sharing this, it's really helpful.

I'm trying to run the program like this:

node browser.js "https://m.tiktok.com/node/video/feed"

and this is throwing this error:

  userAgent = 'Mozilla/5.0 (iPhone; CPU iPhone OS 11_0 like Mac OS X) AppleWebKit/604.1.38 (KHTML, like Gecko) Version/11.0 Mobile/15A372 Safari/604.1'

SyntaxError: Unexpected token =
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/mathi/Escritorio/tiktokapi/tiktok-signature/browser.js:1:16)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

I'm pretty new with node-js so it might be because of some really basic error I made. Please let me know if anyone experienced the same or if you know what could be the problem :) Thanks!

TrueCarry commented 4 years ago

What version of node do you use? Seems like it doesn't recognize class.

mathigatti commented 4 years ago

➜ ~ node -v v10.19.0

TrueCarry commented 4 years ago

If you can update to 12, it should help.

hackmoore commented 4 years ago

Was having the issue, updating to v13.8.0 fixed for me - Thanks!