TypeError: Buffer.alloc is not a function
This error occurs due to missmatch node version so please node version on my machine like this:
sudo npm cache clean -f
sudo npm install -g n
sudo n stable
The new Buffer
API is only available in v5.10.0+, so you'll need to upgrade to use it.
If you want to view the docs for v5.7.1, you can go here.
FWIW the new Buffer
API is also now available in node v4.x as of v4.5.0.