microsoft / ghcrawler

Crawl GitHub APIs and store the discovered orgs, repos, commits, ...

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

zhangysh1995 opened this issue · comments

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:

  • OS: Ubuntu 16.04
  • npm: 3.5.2
  • node: 4.7.0

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?

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.

The version is specified in Dockerfile:
FROM node:6