Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

nodejs: error when installing hiredis package

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
like image 297
Sam Avatar asked Jan 29 '14 13:01

Sam


People also ask

How do I repair a failed node install attempt?

Then I clicked on the installation file to run the Node.js Setup Wizard (node-v15.14.0-x64.msi). There is a second option to repair the install attempt: "Repair". Click on that button and the install wizard completes the repair with full exit. The program notices that some elements have not been completed.

How much space does it take to install Node JS on Windows?

This script will install Python and the Visual Studio Build Tools, necessary to compile Node.js native modules. Note that Chocolatey and required Windows updates will also be installed. This will require about 3 Gb of free disk space, plus any space necessary to install Windows updates. This will take a while to run.

What is HTTP-errors module in Node JS?

Introduction to Object Oriented Programming in JavaScript How to update Node.js and NPM to next version ? How to update NPM ? HTTP-errors module is used for generating errors for Node.js applications. It is very easy to use. We can use it with express, Koa, etc. applications. We will implement this module in an express application.

What is the best way to run Node JS?

nvm is a popular way to run Node.js. It allows you to easily switch the Node.js version, and install new versions to try and easily rollback if something breaks. It is also very useful to test your code with old Node.js versions.


1 Answers

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
like image 64
Andrei Karpushonak Avatar answered Nov 15 '22 01:11

Andrei Karpushonak