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

Build fails on Windows 7 #64

Open
magicalhobo opened this issue Oct 28, 2013 · 13 comments
Open

Build fails on Windows 7 #64

magicalhobo opened this issue Oct 28, 2013 · 13 comments

Comments

@magicalhobo
Copy link

Here's the output from npm:

C:\temp>npm install geoip
npm http GET https://registry.npmjs.org/geoip
npm http 304 https://registry.npmjs.org/geoip

> geoip@0.4.10 install C:\temp\node_modules\geoip
> node-gyp rebuild


C:\temp\node_modules\geoip>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
C:\temp\node_modules\geoip\build\binding.sln : Solution file error MSB5004: The solution file has two projects named "geoip".
gyp ERR! build error
gyp ERR! stack Error: `C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\temp\node_modules\geoip
gyp ERR! node -v v0.10.4
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! geoip@0.4.10 install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the geoip@0.4.10 install script.
npm ERR! This is most likely a problem with the geoip package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls geoip
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "geoip"
npm ERR! cwd C:\temp
npm ERR! node -v v0.10.4
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     C:\temp\npm-debug.log
npm ERR! not ok code 0
@kuno
Copy link
Owner

kuno commented Oct 29, 2013

@magicalhobo

Thanks for report, let me take a look.

@kuno
Copy link
Owner

kuno commented Oct 30, 2013

@magicalhobo

Sorry, I have not virtual studio installed, os, it is quite difficult for me to testing that.

Can you install other node c++ addon ? such as ws?

@magicalhobo
Copy link
Author

Yes, ws and other C++ modules install fine for me. I have node-gyp working on my machine.

I know it's difficult if you don't have the environment setup, so let me know if there's anything I can try to get you more information.

@kuno
Copy link
Owner

kuno commented Nov 1, 2013

@magicalhobo

Can you clone the repo and do make rebuild at the root, then post the result here?

@magicalhobo
Copy link
Author

I think the closest thing that makes sense in Windows would be

SET NODE_ENV=test & node-gyp rebuild

Which gives this output:

gyp info it worked if it ends with ok
gyp info using node-gyp@0.10.10
gyp info using node@0.10.4 | win32 | x64
gyp info spawn python
gyp info spawn args [ 'C:\\Users\\Sean\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\gyp\\gyp',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'msvs',
gyp info spawn args   '-G',
gyp info spawn args   'msvs_version=auto',
gyp info spawn args   '-I',
gyp info spawn args   'D:\\geoip\\build\\config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Sean\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   'C:\\Users\\Sean\\.node-gyp\\0.10.4\\common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=C:\\Users\\Sean\\.node-gyp\\0.10.4',
gyp info spawn args   '-Dmodule_root_dir=D:\\geoip',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--generator-output',
gyp info spawn args   'D:\\geoip\\build',
gyp info spawn args   '-Goutput_dir=.' ]

module.js:340
    throw err;
          ^
Error: Cannot find module 'nan'
    at Function.Module._resolveFilename (module.js:338:15)
    at Function.require.resolve (module.js:384:19)
    at [eval]:1:33
    at Object.<anonymous> ([eval]-wrapper:6:22)
    at Module._compile (module.js:456:26)
    at evalScript (node.js:532:25)
    at startup (node.js:80:7)
    at node.js:901:3
gyp: Call to 'node -p -e "require('path').dirname(require.resolve('nan'))"' returned exit status 8. 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 (C:\Users\Sean\AppData\Roaming\npm\node_modules\node-gyp\lib\configure.js:424:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\\Users\\Sean\\AppData\\Roaming\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd D:\geoip
gyp ERR! node -v v0.10.4
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok

@kuno
Copy link
Owner

kuno commented Nov 5, 2013

@magicalhobo

You need install npm module nan first, I think.

@kingsumos
Copy link

C:\temp\node_modules\geoip\build\binding.sln : Solution file error MSB5004: The solution file has two projects named "geoip".

This because the libgeoip target name is also "geoip". Then node-gyp is creating a solution file (binding.sln) containing two projetcs with same name.
But even after fixing this by renaming the target name from "geoip" to "libgeoip" the build fails while compiling libgeoip (node-gyp is using MVS compiler to build libgeoip). To skip this issue I'm using a MinGW/Msys libgeoip build.
So I have removed the libgeoip from the dependency list. But now the the build fails while compiling the geoip module:

D:\Node-new\GeoIP>npm install

geoip@0.4.13-dev install D:\Node-new\GeoIP
node-gyp rebuild

D:\Node-new\GeoIP>node "C:\Program Files (x86)\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-gyp\bin\node-gyp.js" rebuild
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
city6.cc
country.cc
country6.cc
city.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\city.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
init.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\country.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
region.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\country6.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
netspeed.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\city6.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
org.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\init.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
utils.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\region.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
global.cc
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\netspeed.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\org.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
d:\node-new\geoip\src\init.h(9): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory (..\src\utils.cc) [D:\Node-new\GeoIP\build\geoip.vcxproj]
C:\Users\sumo.node-gyp\0.10.22\deps\v8\include\v8.h(179): warning C4506: no definition for inline function 'v8::Persistent v8::Persistent::New(v8::Handle)' [D:\Node-new\GeoIP\build\geoip.vc
xproj]
with

T=v8::Object

gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:267:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files (x86)\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\Node-new\GeoIP
gyp ERR! node -v v0.10.22
gyp ERR! node-gyp -v v0.11.0
gyp ERR! not ok

npm ERR! geoip@0.4.13-dev install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the geoip@0.4.13-dev install script.
npm ERR! This is most likely a problem with the geoip package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls geoip
npm ERR! There is likely additional logging output above.
npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files (x86)\nodejs\node.exe" "C:\Program Files (x86)\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd D:\Node-new\GeoIP
npm ERR! node -v v0.10.22
npm ERR! npm -v 1.3.14
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! D:\Node-new\GeoIP\npm-debug.log
npm ERR! not ok code 0

D:\Node-new\GeoIP>

@kingsumos
Copy link

Despites the project name bug, Microsoft Visual Studio doesn't supports C99 extension (they are still developing this in MVS2013).
For instance:
Error 1 error C2057: expected constant expression .\GeoIP\src\city6.cc 72 1 geoip
Error 2 error C2466: cannot allocate an array of constant size 0 .\GeoIP\src\city6.cc 72 1 geoip

@kuno
Copy link
Owner

kuno commented Dec 9, 2013

@kingsumos

why c99 ?, this module is mainly wrote in c++, it's just call libgeoip's functions.

@kingsumos
Copy link

Although the module is in C++ it its using some features from C99, for instance variable-length arrays:
char host_cstr[host_str->Length() + 1];
Visual Studio still doesn't supports variable-length arrays...

@kuno
Copy link
Owner

kuno commented Dec 10, 2013

@kingsumos

Thanks for your clarifications.

@kkoopa
Copy link
Collaborator

kkoopa commented Jun 6, 2014

Just figured I'd add a tip: http://www.appveyor.com/ offers free windows-based CI testing, like Travis does for real operating systems.

@felixfbecker
Copy link

I would really like to see this on Windows

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

5 participants