Skip to content

v10.0.0-rc.0 + npm emitting Buffer deprecation warnings #20160

@Trott

Description

@Trott
  • Version: v10.0.0-rc.0
  • Platform: macOS
  • Subsystem: buffer
$ uname -a
REDACTED-HOSTNAME 16.7.0 Darwin Kernel Version 16.7.0: Tue Jan 30 11:27:06 PST 2018; root:xnu-3789.73.11~1/RELEASE_X86_64 x86_64
$ NVM_NODEJS_ORG_MIRROR=https://nodejs.org/download/rc nvm install 10
v10.0.0-rc.0 is already installed.
Now using node v10.0.0-rc.0 (npm v5.6.0)
$ node -v
v10.0.0-rc.0
$ npm -v
5.6.0
$ npm install left-pad
(node:39380) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
npm WARN saveError ENOENT: no such file or directory, open '/Users/trott/temp/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/Users/trott/temp/package.json'
npm WARN temp No description
npm WARN temp No repository field.
npm WARN temp No README data
npm WARN temp No license field.
npm WARN You are using a pre-release version of node and things may not work as expected

+ left-pad@1.3.0
added 1 package in 0.653s
$ env | grep NODE
$ env  | grep NVM
NVM_CD_FLAGS=
NVM_DIR=/Users/trott/.nvm
NVM_BIN=/Users/trott/.nvm/versions/node/v10.0.0-rc.0/bin
$ which node
/Users/trott/.nvm/versions/node/v10.0.0-rc.0/bin/node
$ which npm
/Users/trott/.nvm/versions/node/v10.0.0-rc.0/bin/npm
$

Turning on trace warnings so we can see what's causing the warning to be emitted:

$ NODE_OPTIONS='--trace-warnings' npm install left-pad 
(node:39545) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
    at showFlaggedDeprecation (buffer.js:159:11)
    at new Buffer (buffer.js:174:3)
    at Object.<anonymous> (/Users/trott/.nvm/versions/node/v10.0.0-rc.0/lib/node_modules/npm/node_modules/tar/lib/parse.js:33:20)
    at Module._compile (internal/modules/cjs/loader.js:678:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
    at Module.require (internal/modules/cjs/loader.js:626:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/trott/.nvm/versions/node/v10.0.0-rc.0/lib/node_modules/npm/node_modules/tar/lib/list.js:8:16)
    at Module._compile (internal/modules/cjs/loader.js:678:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
    at Module.load (internal/modules/cjs/loader.js:589:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
    at Function.Module._load (internal/modules/cjs/loader.js:520:3)
npm WARN saveError ENOENT: no such file or directory, open '/Users/trott/temp/package.json'
npm WARN enoent ENOENT: no such file or directory, open '/Users/trott/temp/package.json'
npm WARN temp No description
npm WARN temp No repository field.
npm WARN temp No README data
npm WARN temp No license field.
npm WARN You are using a pre-release version of node and things may not work as expected

+ left-pad@1.3.0
updated 1 package in 0.64s
$

It seems to be /Users/trott/.nvm/versions/node/v10.0.0-rc.0/lib/node_modules/npm/node_modules/tar/lib/parse.js which should not trigger a warning because it is inside of a node_modules directory. The offending line is:

const gzipHeader = new Buffer([0x1f, 0x8b])

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.confirmed-bugIssues with confirmed bugs.npmIssues and PRs related to the npm client dependency or the npm registry.

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions