pevers / images-scraper

Simple and fast scraper for Google
ISC License
225 stars 70 forks source link

SyntaxError: Unexpected token ILLEGAL #12

Closed davisking closed 7 years ago

davisking commented 7 years ago

I grabbed the code from github and ran the example.js but got an error. I'm running on ubuntu and installed node through apt-get. This was the output I saw from node example.js


/mnt/ssd/more_scrape/node_modules/nightmare/lib/nightmare.js:94
    debug(`WARNING:  load timeout of ${options.loadTimeout} is shorter than go
          ^
SyntaxError: Unexpected token ILLEGAL
    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 Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/mnt/ssd/more_scrape/node_modules/images-scraper/lib/google-images-scraper.js:6:17)
    at Module._compile (module.js:456:26)
    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 Module.require (module.js:364:17)
    at require (module.js:380:17)
    at Object.<anonymous> (/mnt/ssd/more_scrape/node_modules/images-scraper/index.js:1:87)
    at Module._compile (module.js:456:26)
    at Object.Module._extensions..js (module.js:474:10)

Do I have to do anything special to make this work?

pevers commented 7 years ago

Looks like template literals are not supported. This is Node prior 4.3.2, so try to install the latest Node (not from the software center).

davisking commented 7 years ago

Sweet, thanks. Didn't realize the version of node in ubuntu's package manager is crazy old.