'npm install' doesn't actually install the required packages. I had to do 'npm install ws' then run 'node ws.js' Cheers