Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove use of deprecated Buffer() constructor #92

Closed
ManfredLange opened this issue Jun 17, 2019 · 2 comments
Closed

Remove use of deprecated Buffer() constructor #92

ManfredLange opened this issue Jun 17, 2019 · 2 comments

Comments

@ManfredLange
Copy link

Node 10 has deprecated the Buffer constructor 'new Buffer()` (see Node JS Documentation).

While this may not affect the use of node-zookeeper-client within node_modules it becomes a problem when packaging up using webpack and then deploying to a node 10.x (or later) runtime environment, e.g. when running in the current AWS lambda node environment (nodejs 10.x).

When running in such an environment, an error message like the following will be produced:

ERROR	(node:7) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

In the case of AWS lambdas, this leads to non functioning lambdas as the deprecation warning is treated as an error when using nodejs 10.x as the runtime.

@ManfredLange ManfredLange changed the title Remove use of deprecated Buffer functions Remove use of deprecated Buffer() constructor Jun 17, 2019
@alexguan
Copy link
Owner

Changing it seems reasonable, my concerns is that this will make the library requires node.js version older than 6.0.0.

Not sure how many folks has not yet upgraded.

alexguan added a commit that referenced this issue Jun 18, 2019
…and bump the version to 1.0.0. Note: the minimal required version of Node.js will be 6.0.0.0 now.
@ManfredLange
Copy link
Author

Fantastic! Thank you so much for the fast turn around! :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants