6

Trying to install hiredis in nodejs and I'm getting this error. I can't find anything useful on Google. Anyone had this issue ? I'm using latest version of nodejs.

 C:\Users\berthsa\new>npm install hiredis --save npm http GET https://registry.npmjs.org/redis npm http GET https://registry.npmjs.org/hiredis npm http 304 https://registry.npmjs.org/redis npm http 304 https://registry.npmjs.org/hiredis npm http GET https://registry.npmjs.org/bindings npm http 304 https://registry.npmjs.org/bindings > [email protected] install C:\Users\berthsa\new\node_modules\hiredis > node-gyp rebuild C:\Users\berthsa\new\node_modules\hiredis>node "C:\Users\berthsa\AppData\Roaming \npm\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. hiredis.c async.c net.c sds.c ..\..\deps\hiredis\net.c(35): fatal error C1083: Cannot open include file: 'sys /socket.h': No such file or directory [C:\Users\berthsa\new\node_modules\hiredi s\build\deps\hiredis.vcxproj] ..\..\deps\hiredis\async.c(35): fatal error C1083: Cannot open include file: 's trings.h': No such file or directory [C:\Users\berthsa\new\node_modules\hiredis \build\deps\hiredis.vcxproj] ..\..\deps\hiredis\hiredis.c(35): fatal error C1083: Cannot open include file: 'unistd.h': No such file or directory [C:\Users\berthsa\new\node_modules\hiredi s\build\deps\hiredis.vcxproj] c:\users\berthsa\new\node_modules\hiredis\deps\hiredis\sds.h(45): error C2054: expected '(' to follow 'inline' (..\..\deps\hiredis\sds.c) [C:\Users\berthsa\ne w\node_modules\hiredis\build\deps\hiredis.vcxproj] c:\users\berthsa\new\node_modules\hiredis\deps\hiredis\sds.h(45): error C2085: 'sdslen' : not in formal parameter list (..\..\deps\hiredis\sds.c) [C:\Users\be rthsa\new\node_modules\hiredis\build\deps\hiredis.vcxproj] c:\users\berthsa\new\node_modules\hiredis\deps\hiredis\sds.h(45): error C2143: syntax error : missing ';' before '{' (..\..\deps\hiredis\sds.c) [C:\Users\bert hsa\new\node_modules\hiredis\build\deps\hiredis.vcxproj] c:\users\berthsa\new\node_modules\hiredis\deps\hiredis\sds.h(50): error C2054: expected '(' to follow 'inline' (..\..\deps\hiredis\sds.c) [C:\Users\berthsa\ne w\node_modules\hiredis\build\deps\hiredis.vcxproj] c:\users\berthsa\new\node_modules\hiredis\deps\hiredis\sds.h(50): error C2085: 'sdsavail' : not in formal parameter list (..\..\deps\hiredis\sds.c) [C:\Users\ berthsa\new\node_modules\hiredis\build\deps\hiredis.vcxproj] c:\users\berthsa\new\node_modules\hiredis\deps\hiredis\sds.h(50): error C2143: syntax error : missing ';' before '{' (..\..\deps\hiredis\sds.c) [C:\Users\bert hsa\new\node_modules\hiredis\build\deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(53): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\d eps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(83): warning C4267: 'initializing' : conversion from ' size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hire dis\build\deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(104): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(122): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(123): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(135): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(136): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(157): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(158): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(179): warning C4013: 'va_copy' undefined; assuming ext ern returning int [C:\Users\berthsa\new\node_modules\hiredis\build\deps\hiredis .vcxproj] ..\..\deps\hiredis\sds.c(214): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(215): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(225): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(229): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(237): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(245): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(246): warning C4267: '=' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\build\ deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(251): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hir edis\build\deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(257): warning C4267: 'initializing' : conversion from 'size_t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hir edis\build\deps\hiredis.vcxproj] ..\..\deps\hiredis\sds.c(270): warning C4267: 'return' : conversion from 'size_ t' to 'int', possible loss of data [C:\Users\berthsa\new\node_modules\hiredis\b uild\deps\hiredis.vcxproj] gyp ERR! build error gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` fail ed with exit code: 1 gyp ERR! stack at ChildProcess.onExit (C:\Users\berthsa\AppData\Roaming\npm\ 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:797: 12) gyp ERR! System Windows_NT 6.1.7601 gyp ERR! command "node" "C:\\Users\\berthsa\\AppData\\Roaming\\npm\\node_modules \\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild" gyp ERR! cwd C:\Users\berthsa\new\node_modules\hiredis gyp ERR! node -v v0.10.25 gyp ERR! node-gyp -v v0.10.10 gyp ERR! not ok npm ERR! weird error 1 npm ERR! not ok code 0 

1 Answer 1

2

If you are installing hiredis on Windows, and all needed prerequisites are met (like Visual Studio), you shall install fork of hiredis-node with Windows support.

In this case, you have to install it directly from the github tarball:

npm install https://github.com/fuwaneko/hiredis-node/tarball/v0.1.14 
Sign up to request clarification or add additional context in comments.

3 Comments

I'm not sure how that relate to my problem :) Anyway, I already have both 2012 and 2013 ultimate editions installed on my computer. That does not seem to help.
I guess I am by typing npm install hiredis
Installing from the tarball linked in this answer is no longer needed. I was able to successfully install version 0.4.1 of hiredis on Windows 8.1 (VS2013, node v0.12.7, npm v2.11.3).

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.