Can't get Socket.IO to install on Ubuntu VPS server?

I am having trouble to get socket.io installed in the correct directory I guess for it to work with my website. I had it working at one point, however I had to install socketIO in the directory with my website files (so that was cluttered and couldn't be there, i deleted those files and now it no longer works).

My website files are located in: /var/www/

Node.js seems to work fine globally as when I type, node -v anywhere it gives me the version.

I have tried sudo npm install socket.io -g but that didn't fix the issue. Where am I suppose to install socket.io, or how am I suppose to in order to make it work?

Possible duplicate: Getting errors when trying to install socket.io globally

You have to install npm packages in the project folder where your package.json and node_modules folder exist if doing locally. For global installation you must have NODE_PATH variable containing your global package folder, which should be /usr/local/lib/node_modules