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

install-extension command throws Buffer deprecated warning #82524

Closed
samrat-gavale opened this issue Oct 14, 2019 · 30 comments · Fixed by #206415
Closed

install-extension command throws Buffer deprecated warning #82524

samrat-gavale opened this issue Oct 14, 2019 · 30 comments · Fixed by #206415
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions insiders-released Patch has been released in VS Code Insiders upstream-issue-linked This is an upstream issue that has been reported upstream verified Verification succeeded
Milestone

Comments

@samrat-gavale
Copy link

samrat-gavale commented Oct 14, 2019

Issue Type: Bug

PS C:\Users\sagavale> & 'C:\Users\sagavale\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd' --version
1.39.0
9df03c6d6ce97c6645c5846f6dfa2a6a7d276515
x64
PS C:\Users\sagavale> & 'C:\Users\sagavale\AppData\Local\Programs\Microsoft VS Code\bin\code.cmd' --install-extension ecmel.vscode-html-css                                                                                                                            Installing extensions...
Installing extension 'ecmel.vscode-html-css' v0.2.3...
(node:336) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
Extension 'ecmel.vscode-html-css' v0.2.3 was successfully installed.

I have verified that the warning does NOT occur in version 1.36.0 in which similar issue #67534 was fixed.

VS Code version: Code 1.39.0 (9df03c6, 2019-10-09T06:58:04.439Z)
OS version: Windows_NT x64 10.0.19500

System Info
Item Value
CPUs Intel(R) Xeon(R) CPU E5-1650 v3 @ 3.50GHz (12 x 3492)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
native_gpu_memory_buffers: disabled_software
oop_rasterization: disabled_off
protected_video_decode: unavailable_off
rasterization: enabled
skia_deferred_display_list: disabled_off
skia_renderer: disabled_off
surface_synchronization: enabled_on
video_decode: enabled
viz_display_compositor: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 15.91GB (7.99GB free)
Process Argv --folder-uri file:https:///d%3A/code/devcanvas/client/VSCodeExtension
Screen Reader no
VM 0%
Extensions (5)
Extension Author (truncated) Version
vscode-html-css ecm 0.2.3
devinsights Mic 2019.10.11-1
cpptools ms- 0.25.1
vscode-typescript-tslint-plugin ms- 1.2.2
debugger-for-chrome msj 4.12.0
@sandy081 sandy081 added bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions labels Nov 17, 2019
@sandy081 sandy081 added this to the November 2019 milestone Nov 17, 2019
@tristanbarcelon
Copy link

1.40.2 still has this error as well when installing following extensions: formulahendry.code-runner, formulahendry.auto-close-tag, formulahendry.dotnet-test-explorer, formulahendry.docker-explorer, vsciot-vscode.azure-iot-tools, vsciot-vscode.azure-iot-edge, eamodio.gitlens, and a few others. It does appear to be a built-in problem within vscode when installing extensions via cli.

@sandy081
Copy link
Member

sandy081 commented Dec 5, 2019

@bpasero @deepak1556

I am not able to see these warning when running from sources. Also I have not changed any node dependencies from 1.36. I was clue less from where these warnings are coming from. Any help would be appreciated.

@sandy081 sandy081 modified the milestones: November 2019, December 2019 Dec 5, 2019
@bpasero
Copy link
Member

bpasero commented Dec 6, 2019

@sandy081 maybe try this:

  • configure export NODE_OPTIONS=--throw-deprecation
  • run out of sources

From now on you should see stacktraces where the offender is coming from. Alternatively, if we know the extension that is causing this, try to find the deprecated usages of the Buffer constructor.

@sandy081
Copy link
Member

sandy081 commented Dec 9, 2019

Tried this export NODE_OPTIONS=--throw-deprecation and did not help.

@bpasero
Copy link
Member

bpasero commented Dec 9, 2019

@sandy081

~/Development/Microsoft/monaco> code --install-extension ecmel.vscode-html-css  
Installing extensions...
Installing extension 'ecmel.vscode-html-css' v0.2.3...
internal/process/warning.js:127
      throw warning;
      ^

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:156:11)
    at new Buffer (buffer.js:171:3)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/fd-slicer/index.js:109:18
    at pendGo (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/pend/index.js:54:3)
    at onCb (/Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/pend/index.js:41:7)
    at /Applications/Visual Studio Code.app/Contents/Resources/app/node_modules.asar/fd-slicer/index.js:31:7
    at FSReqCallback.wrapper [as oncomplete] (fs.js:477:5) {
  name: 'DeprecationWarning',
  code: 'DEP0005'
}

@sandy081
Copy link
Member

sandy081 commented Dec 9, 2019

Yes running out of source did not work. Tried on insiders and I can see the error now.

Thanks.

@sandy081
Copy link
Member

sandy081 commented Dec 9, 2019

This is coming from yauzl module. Filed issues

thejoshwolfe/yauzl#114
andrewrk/node-fd-slicer#3

@ctf0
Copy link

ctf0 commented Dec 18, 2019

am having the same issue but on usage ex.https://github.com/fabiospampinato/vscode-open-multiple-files

however it show on first run only.

@ArturoDent
Copy link

It appears on fd-slicer the maintainer has no interest in fixing this. Despite nearly 9 million weekly downloads.

On yauzl replacing fd-slicer with a fork fd-slicer2 has been proposed as a fix but it hasn't been merged.

Sigh...

@sandy081
Copy link
Member

might it be an idea to consider replacements for these modules? They both appear to be stale and not had any code changes since prior to this issue being opened 2.5 years ago.

That's a good idea. Will look into that.

And short of that, could this issue at least be tagged with some indicate as to why it appears to have had no movement (such as that it's a dependency issue, and not a vscode issue)?

Thanks, added upstream-issue-linked label

@jdstraye
Copy link

jdstraye commented Jul 6, 2022

I am trying to install 23 extensions so that I have similar work environments without VPN (Windows) and with VPN (Linux). I have observed that all 23 extensions install fine on Windows with

Version: 1.68.1 (system setup)
Commit: 30d9c6cd9483b2cc586687151bcbcd635f373630
Date: 2022-06-14T12:48:58.283Z
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Windows_NT x64 10.0.19044

But I can only install 3 extensions on Linux with

Version: 1.63.2
Commit: 899d46d82c4c95423fb7e10e68eba52050e30ba3
Date: 2021-12-15T09:39:46.686Z
Electron: 13.5.2
Chromium: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 4.12.14-122.60-default

@gjsjohnmurray
Copy link
Contributor

@jdstraye your issue is unlikely to be related to this one. More likely the extensions require a more recent version of VS Code than the 1.63.2 your Linux environment has.

@jdstraye
Copy link

jdstraye commented Jul 6, 2022

@gjsjohnmurray,
100% agree that my company's Linux version is woefully behind, and many of the issues are related to that. But, it has definitely run into the deprecated buffer() error as well. I was hoping these 2 clues would be helpful: Windows vs. Linux and v1.63.2 vs 1.68.1.
If more details would be helpful (e.g., which extension fail with "buffer() deprecated" on 1.63.2 Linux), let me know. My company's connection to extensions on Linux is also woefully slow. It would help if there was a way to download all the .vsix files that you were interested in and try them on CLI.

@gjsjohnmurray
Copy link
Contributor

@jdstraye AFAIK the deprecation warning is only a warning, and only appears when installing using the CLI or when developing extensions. I wouldn't expect any extension to fail because of it. More likely the latest versions of some extension won't install on your older VS Code version.

@Matthew-Cherry87
Copy link

@jdstraye AFAIK the deprecation warning is only a warning, and only appears when installing using the CLI or when developing extensions. I wouldn't expect any extension to fail because of it. More likely the latest versions of some extension won't install on your older VS Code version.

Sure, but what if you're in an enterprise environment and want to push out Visual Studio Code + XYZ extensions to 100s or 1000s of workstations and regularly update said extensions.

From memory, the warning output also pauses the installation of extensions until the user inputs any key into the console window....

All I want is the ability to install extensions via CLI without errors/warnings/additional console windows popping up.

That's hardly an unreasonable request.

@Reemh
Copy link

Reemh commented Aug 25, 2022

Is it possible that this warning is happening only when you have vsce as a devDependencies in the extension? Those problematic packages are used by the vsce. Our code is not really using any package that depends on fd-slicer nor yauzl.

@alfadormx
Copy link

alfadormx commented Jun 18, 2023

Issue detected again in the following version:

Version: 1.79.2 (user setup)
Commit: 695af097c7bd098fbf017ce3ac85e09bbc5dda06
Date: 2023-06-14T08:57:04.379Z
Electron: 22.5.7
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8: 10.8.168.25-electron.0
OS: Windows_NT x64 10.0.22621

Here are the Windows Terminal traces of my script executing the command:

Installing extensions...
Installing extension 'ms-azuretools.vscode-docker'...
(node:7476) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'ms-azuretools.vscode-docker' v1.25.1 was successfully installed.
Installing extensions...
Installing extension 'mhutchie.git-graph'...
(node:8748) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'mhutchie.git-graph' v1.30.0 was successfully installed.
Installing extensions...
Installing extension 'bradlc.vscode-tailwindcss'...
(node:7412) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'bradlc.vscode-tailwindcss' v0.9.11 was successfully installed.
Installing extensions...
Installing extension 'esbenp.prettier-vscode'...
(node:8500) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'esbenp.prettier-vscode' v9.13.0 was successfully installed.
Installing extensions...
Installing extension 'csstools.postcss'...
(node:9548) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'csstools.postcss' v1.0.9 was successfully installed.
Installing extensions...
Installing extension 'pkief.material-icon-theme'...
(node:9276) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'pkief.material-icon-theme' v4.28.0 was successfully installed.
Installing extensions...
Installing extension 'ms-vscode.vscode-typescript-next'...
(node:9264) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'ms-vscode.vscode-typescript-next' v5.2.20230617 was successfully installed.
Installing extensions...
Installing extension 'dbaeumer.vscode-eslint'...
(node:6252) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Extension 'dbaeumer.vscode-eslint' v2.4.0 was successfully installed.

@ghost
Copy link

ghost commented Aug 25, 2023

Same as above:

1.81.1
6c3e3dba23e8fadc360aed75ce363ba185c49794
x64

code-tunnel.exe

code-tunnel ext install C:\Users\me\Downloads\ms-vscode-remote.remote-ssh-0.106.2023082115.vsix
Installing extensions...
(node:13536) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Error: Unable to install extension 'ms-vscode-remote.remote-ssh' as it is not compatible with VS Code '1.81.1'.
    at T.install (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:50:4827)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async y.g (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:28:299)
    at async C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:27:16258
    at async Promise.all (index 0)
    at async y.installExtensions (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:27:16187)
    at async C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:50:25209
    at async Object.me [as main] (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:50:28810)
    at async w (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:14:22007)
Failed Installing Extensions: file:https:///c%3A/Users/sfdahe/Downloads/ms-vscode-remote.remote-ssh-0.106.2023082115.vsix
 sfdahe  code --install-extension C:\Users\sfdahe\Downloads\ms-vscode-remote.remote-ssh-0.106.2023082115.vsix

code.exe

code --install-extension C:\Users\me\Downloads\ms-vscode-remote.remote-ssh-0.106.2023082115.vsix
Installing extensions...
(node:42776) [DEP0005] DeprecationWarning: Buffer() is deprecated due to security and usability issues. Please use the Buffer.alloc(), Buffer.allocUnsafe(), or Buffer.from() methods instead.
(Use `Code --trace-deprecation ...` to show where the warning was created)
Error: Unable to install extension 'ms-vscode-remote.remote-ssh' as it is not compatible with VS Code '1.81.1'.
    at T.install (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:50:4827)
    at process.processTicksAndRejections (node:internal/process/task_queues:96:5)
    at async y.g (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:28:299)
    at async C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:27:16258
    at async Promise.all (index 0)
    at async y.installExtensions (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:27:16187)
    at async C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:50:25209
    at async Object.me [as main] (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cliProcessMain.js:50:28810)
    at async w (C:\Users\sfdahe\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\code\node\cli.js:14:22007)
Failed Installing Extensions: file:https:///c%3A/Users/sfdahe/Downloads/ms-vscode-remote.remote-ssh-0.106.2023082115.vsix

@yous
Copy link

yous commented Dec 1, 2023

On Windows:

C:\> code --version
1.84.2
1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
x64
C:\> set NODE_OPTIONS="--trace-deprecation"
C:\> code --install-extension [email protected]
Installing extensions...
(node:924) [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 (node:buffer:198:11)
    at new Buffer (node:buffer:282:3)
    at C:\Users\yous\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\fd-slicer\index.js:109:18
    at pendGo (C:\Users\yous\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\pend\index.js:54:3)
    at onCb (C:\Users\yous\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\pend\index.js:41:7)
    at C:\Users\yous\AppData\Local\Programs\Microsoft VS Code\resources\app\node_modules.asar\fd-slicer\index.js:31:7
    at FSReqCallback.wrapper [as oncomplete] (node:fs:684:5)
Extension '[email protected]' was successfully installed.

@sandy081 sandy081 modified the milestones: Backlog, March 2024 Feb 19, 2024
sandy081 added a commit that referenced this issue Feb 28, 2024
@sandy081 sandy081 mentioned this issue Feb 28, 2024
@VSCodeTriageBot VSCodeTriageBot added the unreleased Patch has not yet been released in VS Code Insiders label Feb 28, 2024
sandy081 added a commit that referenced this issue Feb 28, 2024
hbons pushed a commit that referenced this issue Feb 28, 2024
@VSCodeTriageBot VSCodeTriageBot added insiders-released Patch has been released in VS Code Insiders and removed unreleased Patch has not yet been released in VS Code Insiders labels Feb 28, 2024
@aeschli aeschli added the verified Verification succeeded label Mar 26, 2024
@microsoft microsoft locked and limited conversation to collaborators Jun 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions insiders-released Patch has been released in VS Code Insiders upstream-issue-linked This is an upstream issue that has been reported upstream verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.