Home Web Development node.js Solution to: stack Error: gyp failed with exit code: 1

Get social!

Webcam Streaming

Streaming webcams via RTSP (Real Time Streaming Protocol) to regular browsers (Chrome, Firefox, Safari, Explorer, Vivaldi) is a POA. Browser support for 99% of the webcams out there just plain sucks. If you want to embed video so all browsers can view it, you use motion jpeg (MJPEG) instead. What you get is a low-quality, video bandwidth hogging webcam stream that most browsers will support. There are other solutions (mostly Flash or Java based), but I've never found one that supported all major browsers (and that was free :-).

So the day came when a customer presented me with a webcam that did not support MJPEG, I knew I had my work cut out for me. However, the smart guys at PHOBOSLAB came up with a totally hacked and clever way to stream webcams using a combination of RTSP and web sockets, which most modern browsers support. I used this solution and so far it is working quite well.

gyp failed with exit code: 1

The solution to webcam streaming as mentioned above requires the use of Node.js and the websockets module. Usually, to install a module, you do something like:

However, when I ran the command, I received the following error:

The first line gives us a good clue -- "node: not found". Typing "node" on the command line displayed another not found error. I knew Node.js was installed. The problem was that on my Linux distrubtion (Ubuntu 14.10), the install of Node.js was to /usr/bin/nodejs, not /usr/bin/node. To solve the problem, I simply linked the file as such:

Problem solved!

Caveats

Unrelated to the problem and solution, if you try the streaming setup mentioned herein, note that your server will be streaming the webcam feeds to all who access them. This can add up to some bandwidth if you have popular public cams.

Keywords

gyp failed with exit code: 1, node.js, ws, websockets

Leave a Reply

Bad Behavior has blocked 55 access attempts in the last 7 days.