microsoft / ghcrawler

Crawl GitHub APIs and store the discovered orgs, repos, commits, ...
MIT License
373 stars 90 forks source link

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode #129

Closed zhangysh1995 closed 6 years ago

zhangysh1995 commented 6 years ago

When run the default command node bin/www.js, I got this error:

zhangysh1995@ubuntu-zhangyushao:~/Tools/ghcrawler$ node bin/www.js /home/zhangysh1995/Tools/ghcrawler/bin/www.js:12
let port = normalizePort(config.get('CRAWLER_SERVICE_PORT') || process.env.PORT || '3000');
^^^

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Function.Module.runMain (module.js:442:10)
    at startup (node.js:136:18)
    at node.js:966:3

Versions:

I'm quite new to node and have difficulty read the original source code. Could you please provide simple usage examples or sample configure files?

jeffmcaffer commented 6 years ago

It's probably not documented in the readme but you need a later version of Node. I'm going to guess at something > 6.* but 8.10.0 is the current stable release. I personally use 8.9.4.

@geneh Can you update the readme? Probably should do the same for the ClearlyDefined repos as well.

geneh commented 6 years ago

The version is specified in Dockerfile: FROM node:6

geneh commented 6 years ago

Updated README: https://github.com/Microsoft/ghcrawler/blob/develop/README.md#node-version