Yarn: (node:3184) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues.

Created on 1 May 2018  路  26Comments  路  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?

I don't think it's a bug but might be good to resolve it in the future.
What is the current behavior?
The deprecation warning is thrown when installing a package with yarn add and node >= 10.
If the current behavior is a bug, please provide the steps to reproduce.

What is the expected behavior?
No deprecation warnings.
Please mention your node.js, yarn and operating system version.

macOS High Sierra, version 10.13.4
Node v. 10
Yarn v. 1.6.0

triaged

Most helpful comment

+1

All 26 comments

+1

This is already being tracked in #5477

So we need to revert to using npm for projects until this is complete right? I get reminded of said error via yarn but not with npm. But all packages fail to install via yarn.

@denisinla if packes fail to install you're having some unrelated issue, although you will still see this warning if you're using Node 10 which might be confusing. This is a _deprecation warning_ in Node, the old API is still present and works like before.

I suggest you open a separate issue discribing your error (and include the error log), this issue will most likely be closed since it's a dupe.

馃憤

How to fix this?

I got this problem after trying to install Inkscape via brew and uninstalling it because brew fails to install some dependencies.

  • Mac OS 10.13.4
  • node v10.1.0
  • yarn 1.6.0
(node:13897) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.

+1
Mac OS 10.13.4
node 10.1.0
yarn 1.6.0

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

+1

Windows 10 v1803
node v10.1.0
yarn v1.6.0

$ yarn run dev

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

This is showing up a lot recently. The fix is already committed to master, just wait for a new release https://github.com/yarnpkg/yarn/issues/5477

Does anyone know how to install this version? with a fresh install, this is still happening fo rme

It looks like the nightly msi version is broken, as it installs a different version of yarn than it says it's downloading: https://yarnpkg.com/en/docs/install#windows-nightly

It says it's installing 1.10.0, but installs 1.9.0

Idk, maybe I'm just still having the same problem...this is my console output

$ yarn
yarn install v1.9.0-20180706.1017
warning package-lock.json found. Your project contains lock files generated by tools other than
 Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies c
aused by unsynchronized lock files. To clear this warning, remove package-lock.json.
[1/4] Resolving packages...
[2/4] Fetching packages...
[-------------------------------------------------------------------------------------] 0/1449(
node:11232) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability
issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
error [email protected]: The platform "win32" is incompatible with this module.

It looks like it's using v1.9.0, but the package.json version is 1.10.0...idk, can I just use npm to install yarn? Is there some reason yarn needs it's own installer?

Ok, it worked when I npm install yarn@latest.

Just brew upgrade yarn

+1

still same :( why do even such minor issue don't get fixed . Really hate those irritating warning

I'm also getting this error with the latest version of Yarn (1.9.4)

+1 (1.9.4)

still warning on yarn 1.9.4

Can confirm with 1.9.4 error is still present.

And in 1.10.0 too.

Having the same issue with node > 10, angular-cli 6.2.0 and webpack-cli 3.1.0. No yarn installed or used.

It appears fixed in yarn 1.10.1 馃憤 cc/ @manu-st @denisinla

I am having this issue in vs code with the following specs:
Windows 10
[email protected]
[email protected]

If there is anyone that could help it would be immensely appreciated. I do not have a strong development background I am trying to set up a debug environment. Thanks.

Was this page helpful?
0 / 5 - 0 ratings