In attempting to install grunt under Ubuntu 14.04 I kept getting the infamous error:
firstname.lastname@example.org /home/yml/sudo: unable to resolve host cylon
However, in my case I had resolved the sudo error some time ago by setting /etc/hosts and /etc/hostname correctly. It turns out that while installing Titanium Appcelerator, /etc/npmrc was updated with some trash entries listing directory names which were the full text of the sudo error.
Setting prefix="" in /etc/npmrc resolved the problem for me and I was able to install grunt and other node packages.