ip2location / ip2location-nodejs

IP2Location Node.js Module - Knowing where your visitors from.
http://www.ip2location.com
MIT License
97 stars 29 forks source link

Problem with installing with npm install #1

Closed a-pouyabahar closed 7 years ago

a-pouyabahar commented 10 years ago

I've tried to install your module with npm but I got the following error: (By the way I have MS Visual studio 2013 installed)

C:\Parvaneh\analizer\cheshmak related\codes\ip>npm install ip2location-nodejs npm http GET http://registry.npmjs.org/ip2location-nodejs npm http 304 http://registry.npmjs.org/ip2location-nodejs npm http GET http://registry.npmjs.org/bignum npm http 304 http://registry.npmjs.org/bignum npm http GET http://registry.npmjs.org/nan npm http 304 http://registry.npmjs.org/nan

bignum@0.7.0 install C:\Parvaneh\analizer\cheshmak related\codes\ip\node_modules\ip2loca tion-nodejs\node_modules\bignum node-gyp configure build

C:\Parvaneh\analizer\cheshmak related\codes\ip\node_modules\ip2location-nodejs\node_module s\bignum>node "C:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modul es\node-gyp\bin\node-gyp.js" configure build Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch. bignum.cc C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\include\xlocale(337): warning C453 0: C++ exception handler used, but unwind semantics are not enabled. Specify /EHsc [C:\Pa rvaneh\analizer\cheshmak related\codes\ip\node_modules\ip2location-nodejs\node_modules\bi gnum\build\bignum.vcxproj] C:\Parvaneh\analizer\cheshmak related\codes\ip\node_modules\ip2location-nodejs\node_modul es\bignum\node_modules\nan\nan.h(1103): warning C4267: 'initializing' : conversion from ' size_t' to 'int', possible loss of data [C:\Parvaneh\analizer\cheshmak related\codes\ip\n ode_modules\ip2location-nodejs\node_modules\bignum\build\bignum.vcxproj] C:\Parvaneh\analizer\cheshmak related\codes\ip\node_modules\ip2location-nodejs\node_modul es\bignum\node_modules\nan\nan.h(1117): warning C4267: 'initializing' : conversion from ' size_t' to 'int', possible loss of data [C:\Parvaneh\analizer\cheshmak related\codes\ip\n ode_modules\ip2location-nodejs\node_modules\bignum\build\bignum.vcxproj] ..\bignum.cc(9): fatal error C1083: Cannot open include file: 'openssl/bn.h': No such fil e or directory [C:\Parvaneh\analizer\cheshmak related\codes\ip\node_modules\ip2location-n odejs\node_modules\bignum\build\bignum.vcxproj] gyp ERR! build error gyp ERR! stack Error: C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe failed with ex it code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_m odules\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:807:12) gyp ERR! System Windows_NT 6.2.9200 gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modules\node- gyp\bin\node-gyp.js" "configure" "build" gyp ERR! cwd C:\Parvaneh\analizer\cheshmak related\codes\ip\node_modules\ip2location-nodej s\node_modules\bignum gyp ERR! node -v v0.10.28 gyp ERR! node-gyp -v v0.13.1 gyp ERR! not ok npm ERR! bignum@0.7.0 install: node-gyp configure build npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the bignum@0.7.0 install script. npm ERR! This is most likely a problem with the bignum package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! node-gyp configure build npm ERR! You can get their info via: npm ERR! npm owner ls bignum npm ERR! There is likely additional logging output above.

npm ERR! System WindowsNT 6.2.9200 npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node modules\npm\bin\npm-cli.js" "install" "ip2location-nodejs" npm ERR! cwd C:\Parvaneh\analizer\cheshmak related\codes\ip npm ERR! node -v v0.10.28 npm ERR! npm -v 1.4.9 npm ERR! code ELIFECYCLE npm ERR! npm ERR! Additional logging details can be found in: npm ERR! C:\Parvaneh\analizer\cheshmak related\codes\ip\npm-debug.log npm ERR! not ok code 0

tentonaxe commented 9 years ago

You need to install openSSL. Make sure you choose the correct version to match your version of node.js (64bit ->64bit, 32bit ->32bit.) Additionally, i had to go with version 1.0.0q rather than the latest 1.0.2 because 1.0.2 didn't come with the required lib files. https://slproweb.com/products/Win32OpenSSL.html

While this did complete the install without error, I haven't tested further to see if it actually works properly in windows. If i remember to I'll respond later with results.