Can't import 'ws'

I get the following error while trying to import ‘ws’:

$ node websockets-server.js
const TRAILER = Buffer.from([0x00, 0x00, 0xff, 0xff]);

TypeError: this is not a typed array.
at Function.from (native)
at Object. (C:\Users\210020812\bnr\chattrbox\node_modules\ws\lib\PerMessageDeflate.js:8:24)
at Module._compile (module.js:409:26)
at Object.Module._extensions…js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object. (C:\Users\210020812\bnr\chattrbox\node_modules\ws\lib\WebSocket.js:16:27)
at Module._compile (module.js:409:26)

Wondering if I have a typo, I’ve stripped the contents of websockets-server.js down to only:
var WebSocket = require(‘ws’);

and as above, I’ve run from the command line: $node websockets-server.js

Any ideas?

Realized my error: I had an old version of node.js that didn’t recognize the new Buffer methods. Upgraded and problem went away.

@davedauenhauer great detective work! For other folks reading this thread, the ws websocket library requires at least Node version 5 I believe. The latest stable version of 6 (6.9.5 I think) is a good choice for this course.