twitchtv / igdb-api-node

Nodejs Wrapper for IGDB.com API. Requires an API key. Get one at:
https://api.igdb.com/
MIT License
128 stars 15 forks source link

Unexpected token export in version 3.1.2 #26

Closed pwik closed 6 years ago

pwik commented 6 years ago

I'm getting this error when importing the library on a clean install using Node 9.4.0:

C:\git\sandbox\per\igdb-plotly\api\node_modules\igdb-api-node\configuration.js:1
(function (exports, require, module, __filename, __dirname) { export default {
                                                              ^^^^^^
SyntaxError: Unexpected token export
    at new Script (vm.js:51:7)
    at createScript (vm.js:138:10)
    at Object.runInThisContext (vm.js:199:10)
    at Module._compile (module.js:624:28)
    at Module._extensions..js (module.js:671:10)
    at Object.require.extensions.(anonymous function) [as .js] (C:\git\sandbox\per\igdb-plotly\api\node_modules\babel-register\lib\node.js:152:7)
    at Module.load (module.js:573:32)
    at tryModuleLoad (module.js:513:12)
    at Function.Module._load (module.js:505:3)
    at Module.require (module.js:604:17)

Seems like the distributed configuration.js is using ES6 module syntax. Version 3.1.1 works great though.

krazyjakee commented 6 years ago

You're totally right. I have pushed a new version to fix this (3.1.3). I have run tests but please let me know if this works for you.

pwik commented 6 years ago

Yeah, 3.1.3 works fine.

krazyjakee commented 6 years ago

Great! Thanks for taking the time to report this.