NodeJS + NPM “Cannot find module”

TL;DR: install your NPM packages globally. Like this (where “homebridge” is whatever package you are installing):

sudo npm install homebridge -g

This was driving me crazy. I have been trying to install a couple of NPM packages with dependencies, and run them at startup as a service on an Ubuntu server. I knew the packages weren’t ending up in the right place (even when run as sudo), but I couldn’t figure out why.

Using the -g (global) option cleared everything back up. Now all the dependencies are installed for all users, and my service starts without errors.

The errors were like these:

Error: Cannot find module 'request'

Continue reading

Motorola S305 Headphones

You know how every time you pull out your headphones–they seem to have magically tangled themselves up again? Or how they manage to get caught on everything, or slip out of the connector? Its time to cut the cable.

I bought theĀ MOTOROKR S305 Bluetooth Headphones a few months ago and I’m loving them. Use these with my iPhone 3Gs at my desk and on my commute. They sound fantastic, the on-ear controls are convenient and [the best part] there are no pesky wires! Continue reading