Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in poke.io.js? #51

Closed
pokejones22 opened this issue Jul 21, 2016 · 5 comments
Closed

Error in poke.io.js? #51

pokejones22 opened this issue Jul 21, 2016 · 5 comments

Comments

@pokejones22
Copy link

pokejones22 commented Jul 21, 2016

Forgive me if this is a noob question, I have not used node.js much and mostly write in Objective-C and Swift.

I have created ichooseyou.js that simply contains:

var Pokeio = require('pokemon-go-node-api');

When I run it, I get the following error:

/Users/XXX/node_modules/pokemon-go-node-api/poke.io.js:21
const {RequestEnvelop, ResponseEnvelop} = pokemonProto;
      ^

SyntaxError: Unexpected token {
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/XXX/Desktop/pokemonhugo/ichooseyou.js:3:14)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

Any ideas?

@gallexme
Copy link

@pokejones22 u will need a newer NodeJS version as it uses ES6 Features

@pokejones22
Copy link
Author

So, if I do node --version
I get v5.10.1

But when I do brew upgrade node
Error: node 6.3.0 already installed

@pokejones22
Copy link
Author

@gallexme do I somehow have two versions of node installed?

@pokejones22
Copy link
Author

pokejones22 commented Jul 21, 2016

Never mind that, got it upgraded using nvm install node --reinstall-packages-from=node

Now when I run the ichooseyou.js script I get a new error:

module.js:568
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: Module version mismatch. Expected 48, got 47.
    at Error (native)
    at Object.Module._extensions..node (module.js:568:18)
    at Module.load (module.js:458:32)
    at tryModuleLoad (module.js:417:12)
    at Function.Module._load (module.js:409:3)
    at Module.require (module.js:468:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/XXX/node_modules/bignum/index.js:4:11)
    at Module._compile (module.js:541:32)
    at Object.Module._extensions..js (module.js:550:10)

@pokejones22
Copy link
Author

GOT IT! Just had to reinstall bignum! Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants