> (Node-Gyp rebuild 2> builderror.log) || (Exit 0)

Asked

Viewed 126 times

0

I’m running sudo npm install websocket on my Mac with nodejs but causes me this error, how to fix?

npm install websocket
-
> [email protected] install /Users/Vinicius/node_modules/websocket
> (node-gyp rebuild 2> builderror.log) || (exit 0)

  CXX(target) Release/obj.target/bufferutil/src/bufferutil.o
  SOLINK_MODULE(target) Release/bufferutil.node
  CXX(target) Release/obj.target/validation/src/validation.o
  SOLINK_MODULE(target) Release/validation.node
[email protected] node_modules/websocket
├── [email protected]
├── [email protected] ([email protected])
└── [email protected] ([email protected])
  • What version of Node.js are you using? (does node -v to give you the version)

  • @Sergio v0.12.7 is what turned me on

  • In the documentation on github it says that it supports versions 0.8 and 0.10. Maybe that’s the problem.

  • @Sergio I downloaded version 0.8 and returns me now when installing, this big error https://jsfiddle.net/L43gtw6b/

1 answer

0

It is necessary to have the Node-Gyp dependency.

First you should check which version of Python which is installed on your machine, recommended version v2.7 for greater compatibility, as the v3.x. x are not supported.

Then you need to install a compiler C/C++ globally on your Mac, for this use the following library GCC Installer for OSX

Apoś that install Node-Gyp

$ npm install -g Node-Gyp

Now just install the websockets

$ npm install websocket

I hope I helped, hugs and good luck!

  • Python? I did this and the error persists, use Node in version v0.12.7 and when running npm install -g node-gyp it returns these https://jsfiddle.net/eLgdjfvperrors to me/

  • and when performing the same function with sudo ahead it returns me this https://jsfiddle.net/eLgdjfvp/1/ and the sudo npm install websocket returns me the same thing

  • Yes Python! In the Node-Gyp documentation itself you have this observation and ask for GCC as a dependency as well. Another alternative would be to use a previous stable version of Node.js v0.10.36 and try to install, as there may be a compatibility problem between Node-Gyp and version v0.12.7 of Node.js

Browser other questions tagged

You are not signed in. Login or sign up in order to post.