Armax / Pokemon-GO-node-api

Pokemon GO api node.js library
MIT License
875 stars 198 forks source link

Cannot build s2geometry-node #64

Closed adrianpanicek closed 8 years ago

adrianpanicek commented 8 years ago

I've tried many times and many tips over the internet to build s2geometry using node-gyp but each time it fails on errors like

..\geometry\s1interval.cc(249): error C2065: 'M_PI': undeclared identifier [C:\
nodejs\poke\node_modules\s2geometry-node\build\NativeExtension.vcxproj

I'm pasting a npm-debug.log

npm-debug.txt

npm -v 3.10.5

node -v v4.4.7

SzymonLisowiec commented 8 years ago
sudo apt-get install build-essential
npm install -g pokemon-go-node-api

This working for me.

LASkuma commented 8 years ago

The build-essential doesn't work for me. It's already installed and still cannot pass s2geometry-node build.

kfernandes29 commented 8 years ago

I still can't figure this out either. In the mean time, what I did was

npm install --save pokemon-go-node-api@1.2.2

cypherix93 commented 8 years ago

It's an issue on Windows machines. @billyriantono said he would look for a fix. Right now we are kinda stumped on Windows.

Meanwhile, try booting up a linux VM and see if it npm installs.

vekexasia commented 8 years ago

I've some issues with "isnan has not been declared"

FabioAntunes commented 8 years ago

I'm on linux and I'm getting this:

module.js:327
    throw err;
    ^

Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:325:15)
    at Function.Module._load (module.js:276:25)
    at Module.require (module.js:353:17)
    at require (internal/module.js:12:17)
    at [eval]:1:1
    at Object.exports.runInThisContext (vm.js:54:17)
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:409:26)
    at node.js:579:27
    at nextTickCallbackWith0Args (node.js:420:9)
gyp: Call to 'node -e "require('nan')"' returned exit status 1 while in binding.gyp. while trying to load binding.gyp
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/fabio/.nvm/versions/node/v4.4.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Linux 3.19.0-65-generic
gyp ERR! command "/home/fabio/.nvm/versions/node/v4.4.0/bin/node" "/home/fabio/.nvm/versions/node/v4.4.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/fabio/playground/gomap/node_modules/s2geometry-node
gyp ERR! node -v v4.4.0
gyp ERR! node-gyp -v v3.3.1
gyp ERR! not ok 

I have also tested with node 5.9.1 and 6.3.1

vekexasia commented 8 years ago

@FabioAntunes try with

sudo npm install -g nan

Youi'll have nan but it won't compile either way

FabioAntunes commented 8 years ago

@vekexasia thanks for the tip, that doesn't work but I tried npm install nan to install it locally and it did compile

vekexasia commented 8 years ago

shit. which linux are you on?

FabioAntunes commented 8 years ago

Elementary OS, basically it's ubuntu 14.04 the weird thing is yesterday I tried this repo on this machine and everything worked fine. Then I created a new folder for a fresh project and suddenly it didn't compile anymore

vekexasia commented 8 years ago

i'm on 16.04 and it just don't work :(

FabioAntunes commented 8 years ago

@vekexasia you are not the only one, @LASkuma had the same problem https://github.com/d-pollard/Pokemon-GO-node-api/commit/526d671084d996837cd3dc06ece1be5e790636cf#commitcomment-18350298

billyriantono commented 8 years ago

Sorry for the nan problem ... i have removed from package.json but i am miss in one file have been updated in s2geometry-node@1.2.2

kfernandes29 commented 8 years ago

Can I build it on my Mac for a windows machine?

Luzifix commented 8 years ago

i have to problems with s2geometery.

console: http://pastebin.com/Xvu53Ts1 npm-log: http://pastebin.com/MShX1K4T System: Ubuntu 14.04 Node: 6.3.0 NPM: 3.8.8

FunkeDope commented 8 years ago

I couldn't get it to build on Ubuntu 16.04 on my Chromebook, but it did build okay on a 15.04 VM I have on my desktop...

billyriantono commented 8 years ago

@Luzifix have you try npm install s2geometry-node ?

Luzifix commented 8 years ago

@billyriantono Same error :( i install build-essential but this not really help.

Luzifix commented 8 years ago

After reinstall node & npm on linux it works fine :)

IHFF12 commented 8 years ago

In my case, the problem was Windows. I have Visual Studio 2016, so that could be part of the issue.

I made a Virtual Box for Ubuntu and I got the API running in under 10 minutes. I highly recommend using Virtual Box for developing anyway. Linux is the best!

Edit: I run Ubuntu 16.0. I didn't have to install build-essential.

coolaj86 commented 8 years ago

Fixed in https://github.com/Armax/Pokemon-GO-node-api/pull/165 by using pure JavaScript - no C++ or compiler necessary.