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.

Answer from mscdex on Stack Overflow
Discussions

TypeError: Buffer.alloc is not a function, requires Node v4.5.0
Got the following error: sharp@0.18.0 install /tmp/test/node_modules/sharp node-gyp rebuild /tmp/test/node_modules/sharp/node_modules/tar/lib/pack.js:32 const EOF = Buffer.alloc(1024) ^ TypeError: ... More on github.com
🌐 github.com
6
June 15, 2017
node.js - npm ERR! Buffer.alloc is not a function - Stack Overflow
I am new in Angular 2. I want to install npm in my windows system. but I got the error below: npm ERR! Buffer.alloc is not a function npm ERR! A complete log of this run can be found in: npm ER... More on stackoverflow.com
🌐 stackoverflow.com
`Buffer.alloc` is not a function
Description Seems like the Buffer.alloc api was introduced in node v5.10+. Since I'm using node v5.9.1, and ava's package.json specifies valid engines as ">=4", I'll have t... More on github.com
🌐 github.com
3
July 11, 2017
node.js - TypeError: Buffer.alloc is not a function while accessing firebase tools - Stack Overflow
I am trying to access firebase console from my terminal, but due to this error I am not able too I checked this post too, but didn't quite understand as I haven't worked on node.js before Thanks in More on stackoverflow.com
🌐 stackoverflow.com
August 19, 2017
🌐
Meteor
forums.meteor.com › help
[SOLVED] [TypeError: Buffer.alloc is not a function] Unable to load plugin meteor - help - Meteor Forum
January 10, 2018 - I need some help here. I’m creating a simple app with Meteor Blaze just to fill the gap since when I stopped using it 12 month ago. I’m trying to deploy this app to DO with mup https://github.com/zodern/meteor-up Runningmup deploy I got this error (I’m no t using Buffer in my app code): [TypeError: Buffer.alloc is not a function] Unable to load plugin meteor
🌐
GitHub
github.com › lovell › sharp › issues › 847
TypeError: Buffer.alloc is not a function, requires Node v4.5.0 · Issue #847 · lovell/sharp
June 15, 2017 - Got the following error: sharp@0.18.0 install /tmp/test/node_modules/sharp node-gyp rebuild /tmp/test/node_modules/sharp/node_modules/tar/lib/pack.js:32 const EOF = Buffer.alloc(1024) ^ TypeError: Buffer.alloc is not a function at Object...
Author: lovell
🌐
Stack Overflow
stackoverflow.com › questions › 46093777 › npm-err-buffer-alloc-is-not-a-function
node.js - npm ERR! Buffer.alloc is not a function - Stack Overflow
I am new in Angular 2. I want to install npm in my windows system. but I got the error below: npm ERR! Buffer.alloc is not a function npm ERR! A complete log of this run can be found in: npm ER...
🌐
GitHub
github.com › avajs › ava › issues › 1446
`Buffer.alloc` is not a function · Issue #1446 · avajs/ava
July 11, 2017 - const test = require('ava') const users = require('../resources/users.methods') test('should return all users in db', async function (t) { const fetchedUsers = await users.getAll() t.truthy(fetchedUsers.length) }) $ ava D:\Work\server-express\node_modules\ava\lib\snapshot-manager.js:21 const VERSION_HEADER = Buffer.alloc(2); ^ TypeError: Buffer.alloc is not a function at Object.<anonymous> (D:\Work\server-express\node_modules\ava\lib\snapshot-manager.js:21:31) at Module._compile (module.js:413:34) at Object.Module._extensions..js (module.js:422:10) at Module.load (module.js:357:32) at Function
Author: avajs
🌐
Stack Overflow
stackoverflow.com › questions › 45770715 › typeerror-buffer-alloc-is-not-a-function-while-accessing-firebase-tools
node.js - TypeError: Buffer.alloc is not a function while accessing firebase tools - Stack Overflow
August 19, 2017 - Buffer.alloc was added in 5.10, as stated in the history detail, here, due to security issues with unfilled buffers. Hence implementors had to change that quickly, possibly breaking older Node clients. Also I'd suggest, when working with cloud functions, to match their Node version, which (at the time of writing) is Node 6.14.0.
🌐
GitHub
github.com › webtorrent › parse-torrent › issues › 45
'TypeError: Buffer.alloc is not a function' error on nodejs <5.10.0 · Issue #45 · webtorrent/parse-torrent
March 8, 2017 - /usr/local/lib/node_modules/parse-torrent/index.js:110 ;(function () { Buffer.alloc(0) })() ^ TypeError: Buffer.alloc is not a function at /usr/local/lib/node_modules/parse-torrent/index.js:110:24 at Object.<anonymous> (/usr/local/lib/node_modules/parse-torrent/index.js:110:35) 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.<anonymous> (/usr/local/lib/node_modules/parse-torrent/bin/cmd.js:4:20) at Module._compile (module.js:409:26) I have found reason, because of I am using nodejs<5.10.0 .
Author: webtorrent
Find elsewhere
🌐
GitHub
github.com › Unitech › pm2 › issues › 3827
TypeError: Buffer.alloc is not a function · Issue #3827 · Unitech/pm2
July 24, 2018 - /usr/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:27 buf = Buffer.alloc(SIZE) ^ TypeError: Buffer.alloc is not a function at readUntilEnd (/usr/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:27:18) at /usr/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:68:5 at FSReqWrap.oncomplete (fs.js:145:20) pm2 launched in no-daemon mode (you can add DEBUG="*" env variable to get more messages) [2018-07-24T20:35:01.420Z] PM2 log: Launching in no daemon mode [2018-07-24T20:35:01.476Z] PM2 log: [PM2] Starting /src/server/server.js in cluster_mode (1 instance) [2018-07-24T20:35:01.479Z] PM2 log: Starting execution sequence in -cluster mode- for app name:server id:0 [2018-07-24T20:35:01.539Z] PM2 log: App name:server id:0 online [2018-07-24T20:35:01.541Z] PM2 log: [PM2] Done.
Author: Unitech
🌐
Stack Overflow
stackoverflow.com › questions › 65927700 › node-js-throwing-buffer-alloc-is-not-a-function-error
scala.js - node.js throwing "Buffer.alloc is not a function" error - Stack Overflow
January 27, 2021 - sbt:xplatform> test comSetup.js:7 var inBuffer = Buffer.alloc(0); ^ TypeError: Buffer.alloc is not a function at comSetup.js:7:25 at comSetup.js:61:4 at Object.exports.runInThisContext (vm.js:54:17) at [stdin]:8:27 at Object.exports.runInThisContext (vm.js:54:17) at Object.<anonymous> ([stdin]-wrapper:6:22) at Module._compile (module.js:425:26) at node.js:587:27 at doNTCallback0 (node.js:428:9) at process._tickCallback (node.js:357:13) This is after updating my installation of node to 15.7.0.
🌐
GitHub
github.com › felixrieseberg › npm-windows-upgrade › issues › 118
Buffer.alloc is not a function · Issue #118 · felixrieseberg/npm-windows-upgrade
September 4, 2017 - When running the command npm install --global --production npm-windows-upgrade I get this error: npm ERR! Buffer.alloc is not a function npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\...\AppData\Roaming\npm-cache...
Author: felixrieseberg
🌐
GitHub
github.com › bitcoinjs › bitcoinjs-lib › issues › 1310
Buffer.alloc is not a function error when run via browserify · Issue #1310 · bitcoinjs/bitcoinjs-lib
December 31, 2018 - Then I open an html page with <script src="crypto-browser.js"></script> in it and see the following error in the browser console Uncaught TypeError: Buffer.alloc is not a function
Author: bitcoinjs
🌐
Google Groups
groups.google.com › d › topic › tiddlywiki › Cp-6kiM-Hb4
Node, 5.1.18-prerelease: TypeError: Buffer.alloc is not a function
July 7, 2018 - I think there were some changes to the Buffer module but that was a while ago. Are you using an older version of node?
🌐
GitHub
github.com › websockets › ws › issues › 1041
Error: (SystemJS) Buffer.alloc is not a function · Issue #1041 · websockets/ws
March 11, 2017 - Error: (SystemJS) Buffer.alloc is not a function @http://127.0.0.1:8080/jspm_packages/npm/ws@2.2.0/lib/Constants.js:6:26 @http://127.0.0.1:8080/jspm_packages/npm/ws@2.2.0/lib/Constants.js:2:2 @http://127.0.0.1:8080/jspm_packages/npm/ws@2.2.0/lib/Constants.js:1:31 @http://127.0.0.1:8080/jspm_packages/npm/ws@2.2.0/lib/Constants.js:1:2 @http://127.0.0.1:8080/jspm_packages/npm/ws@2.2.0/lib/WebSocket.js:13:21 @http://127.0.0.1:8080/jspm_packages/npm/ws@2.2.0/lib/WebSocket.js:2:2 @http://127.0.0.1:8080/jspm_packages/npm/ws@2.2.0/lib/WebSocket.js:1:31 @http://127.0.0.1:8080/jspm_packages/npm/ws@2.2.0
Author: websockets
🌐
GitHub
github.com › aws › aws-encryption-sdk-javascript › issues › 1192
Buffer.alloc is not a function (Node.js func inside Browser context issue) · Issue #1192 · aws/aws-encryption-sdk-javascript
August 19, 2023 - build_cryptographic_materials_cache_key_helpers.ts:15 Uncaught TypeError: Buffer.alloc is not a function at build_cryptographic_materials_cache_key_helpers.ts:15:28 (anonymous) @ build_cryptographic_materials_cache_key_helpers.ts:15 · I've also tried creating a Codesandbox to quickly reproduce the issue: https://codesandbox.io/p/sandbox/flamboyant-kowalevski-cmgymq ·
Author: aws
🌐
GitHub
github.com › zodern › meteor-up › issues › 857
[SOLVED] [TypeError: Buffer.alloc is not a function] Unable to load plugin meteor · Issue #857 · zodern/meteor-up
January 10, 2018 - [SOLVED] [TypeError: Buffer.alloc is not a function] Unable to load plugin meteor#857 · Copy link · massimosgrelli · opened · on Jan 10, 2018 · Issue body actions · I installed mup and everything went well until I did mup deploy Then I got this error: [TypeError: Buffer.alloc is not a function] Unable to load plugin meteor ·
Author: zodern
🌐
GitHub
github.com › mage2tv › magento-cache-clean › issues › 25
Buffer.alloc is not a function · Issue #25 · mage2tv/magento-cache-clean
January 6, 2019 - > a:{if(N.b(".php",Fd(a,Q(a)-4))&&(r(Kh(a))?(b=Buffer.alloc(2048),a=Dh.openSync(a,"r"),Dh.readSync(a,b,0,2048,0),Dh.closeSync(a),b=x.a(b)):b=null,a=C(D(Yf(/^\s*namespace\s+([a-z0-9\\]+)/mi,x.a(b)))),b=C(D(Yf(/^\s*class\s+(\w+)/mi,x.a(b)))),a=r(r(a)?b:a)?["\\",x.a(a),"\\",x.a(b)].join(""):null,a=r(a)?wk(a):null,L(a))){de(Bi,"Removing generated code",ze(", ",Z.b(Jk,a)));a=pg(Nh,a);break a}a=null}return a}return null} > ^ > > TypeError: Buffer.alloc is not a function > at Kk (/Users/martins/www/magenteiro2/vendor/mage2tv/magento-cache-clean/bin/cache-clean.js:420:53) > at /Users/martins/www/magen
Author: mage2tv
🌐
GitHub
github.com › metafloor › bwip-js › issues › 86
Buffer.alloc is not a function · Issue #86 · metafloor/bwip-js
September 16, 2017 - Buffer.alloc is not a function#86 · Copy link · bhargavmullakuru · opened · on Sep 16, 2017 · Issue body actions · Hi im getting some error..can you help me with that · No one assigned · No labels · No labels · No projects · No milestone · None yet · No branches or pull requests ·
Author: metafloor