soyuka / pidusage

Cross-platform process cpu % and memory usage of a PID
MIT License
512 stars 55 forks source link

Buffer.alloc issue #71

Closed Unitech closed 6 years ago

Unitech commented 6 years ago
nodejs version: 4.2.6
pm2 3.0.0
npm 6.1.0
/usr/local/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:26
buf = Buffer.alloc(SIZE)
^
TypeError: Buffer.alloc is not a function
at readUntilEnd (/usr/local/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:26:18)
at /usr/local/lib/node_modules/pm2/node_modules/pidusage/lib/procfile.js:67:5
at FSReqWrap.oncomplete (fs.js:82:15)

https://github.com/Unitech/pm2/issues/3816

Unitech commented 6 years ago

Seems that buffer.alloc is only available after node 4.5

sandrocsimas commented 6 years ago

@Unitech, I'm getting this error using node version "carbon" (8.11.3).

soyuka commented 6 years ago

@sandrocsimas please update pm2 see https://github.com/Unitech/pm2/issues/3827

sandrocsimas commented 6 years ago

Thanks @soyuka, I updated yesterday!