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

extension installation using CLI leads to UnhandledPromiseRejectionWarning and hangs #32381

Closed
pervezfunctor opened this issue Aug 12, 2017 · 21 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug extensions Issues concerning extensions verified Verification succeeded
Milestone

Comments

@pervezfunctor
Copy link

Installing any extension, using code CLI, like

code --install-extension EditorConfig.EditorConfig

leads to the following message and the command hangs
Found 'EditorConfig.EditorConfig' in the marketplace. Installing... (node:16346) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): TypeError: this._state.then is not a function (node:16346) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

  • VSCode Version: 1.15
  • OS Version: Ubuntu 17.04, Fedora 26

Extensions can be installed from within the editor, without any problem.

@vscodebot vscodebot bot added extensions Issues concerning extensions new release labels Aug 12, 2017
@perveziqbal
Copy link

Same problem on Windows 10 too.

@gperdomor
Copy link

Same problem on macOS Sierra 10.12.6 and VSCode 1.15

@CreatorMetaSky
Copy link

I have the same problem with @gperdomor

@yujiangshui
Copy link

yujiangshui commented Aug 16, 2017

I have this too, how to fix it?

code -v
1.15.0
8b95971

node -v
v6.3.0

npm -v
3.10.3

macOS Sierra 10.12.4 (16E195)

@wssgcg1213
Copy link

Any ideas?

@murilodag
Copy link

+1

@Toxblh
Copy link

Toxblh commented Aug 17, 2017

Same problem on macOS Sierra 10.12.6 and VSCode 1.15.1

@Drusantia
Copy link

Drusantia commented Aug 17, 2017

Same issue.

VS Code version info from About (latest):
Version 1.15.1
Commit 41abd21
Date 2017-08-16T17:16:27.618Z
Shell 1.6.6
Renderer 56.0.2924.87
Node 7.4.0
Architecture x64

node --version
v8.4.0
npm --version
5.3.0

OS is latest x64 Kali linux.

@decoomanj
Copy link

I have three plugins, and they all fail! The editor doesn't even start. Very disappointing! 👎

@wssgcg1213
Copy link

Any one is dealing with it? I believe it's a bug...

@jvzanatta
Copy link

jvzanatta commented Aug 17, 2017

Same problem on
Mint 18.2 (ubuntu 16.04 based),
vscode 1.15,
node v6.11.2
npm 3.10.10

@knatten
Copy link

knatten commented Aug 18, 2017

I'm seeing the same with

  • VSCode Version: 1.15.1 41abd21
  • OS Version: macOS 10.10.5 (14F2511)

@joaomoreno joaomoreno added this to the August 2017 milestone Aug 18, 2017
@joaomoreno joaomoreno assigned joaomoreno and unassigned sandy081 Aug 18, 2017
@joaomoreno joaomoreno added the bug Issue identified by VS Code Team member as probable bug label Aug 18, 2017
@joaomoreno
Copy link
Member

joaomoreno commented Aug 18, 2017

Sorry for that guys. Current workaround is to install extensions through the UI.

cc @jrieken Issue appeared with e150699 😢

@jrieken
Copy link
Member

jrieken commented Aug 18, 2017

ops

@Sneezry
Copy link
Member

Sneezry commented Aug 18, 2017

Hi @joaomoreno , I'm SDE at Microsoft work for IoT DevKit https://microsoft.github.io/azure-iot-developer-kit/

We have published one-click install script to help developers to setup dev environment, including install vscode and arduino extension. https://microsoft.github.io/azure-iot-developer-kit/docs/get-started/

To install extension with CLI is an important step in our installation script, and this issue may break our script.

Could you please tell us more information about when this issue will be fixed? To our one-click script, we have no workaround currently. Thanks.

@joaomoreno
Copy link
Member

This issue is fixed now in master and the fix will be released at the end of the month.

@zjrunner
Copy link
Member

@Sneezry - agree this was an unfortunate hiccup as I was trying to get started with my IoT dev board. I ended up having to install the cpp extension manually, then commented out a line from out\cli.js (//'installCppExtension') and hopefully I'm back to green. Looking forward to the code fix release.

@amiteshhh
Copy link

I found one workaround(at-least worked for me :) )
My system is behind proxy but everything working fine before upgrading to 1.15.1(proxy settings is configured)
I tried both installing through Extension UI and install from vsix file, it failed without error. Installing by command line throwing the same error mentioned in this thread.

Whats worked is:

Step 1: Install through command line (It will fail)
Step 2: Once it failed, install the same through UI

@Sneezry
Copy link
Member

Sneezry commented Aug 31, 2017

@amiteshhh this issue is only related with installing extensions from marketplace with CLI. Both installing from GUI or local vsix file are okay.

@bpasero bpasero added the verified Verification succeeded label Sep 1, 2017
@michaelherndon
Copy link

I'm having the same issue with v 1.15.1.

Though it is possible to use code --install-extension {path/to/package.vsix} to install a package from the command line. Which is useful if you're trying to install the same extensions for multiple users.

$name = "publisher.package"

$pattern = "<script class=`"vss-extension`" defer=`"defer`" type=`"application\/json`">(.*?)<\/script>"
$regex = [regex]"(?m)$pattern"
$dom = (New-Object Net.WebClient).DownloadString("https://marketplace.visualstudio.com/items?itemName=$name");


  if($dom -and $dom -match $pattern) {
       $matches = $regex.Match($dom)
       $jsonText = $matches[0].Groups[1]

       $json = ConvertFrom-Json $jsonText

       $version = $Json.versions[0].version
       $parts = $name.Split(".")
       $publisher = $parts[0]
       $package = $parts[1]

       $packageUrl = "https://marketplace.visualstudio.com/_apis/public/gallery/publishers/$publisher/vsextensions/$package/$version/vspackage"

    Write-Host "vscode: install $name"
    Write-Host "----------------------------------------"
    Invoke-RestMethod -Method Get -Uri $packageUrl -OutFile "$Env:Temp\$name.vsix" 
    code --install-extension "$Env:Temp\$name.vsix"
    Write-Host ""
}

The code above could use more defense coding, however, its to demonstrate that you can do the following:

  • grab the home page of the extension
  • parse the json in the page for the latest version number
  • assemble the url for the vsix package
  • download the vsix package.
  • install it from the command line.

@yujiangshui
Copy link

@joaomoreno seems like vscode not publish new version at the end of August? We still waiting for this bugfix.

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 17, 2017
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 verified Verification succeeded
Projects
None yet
Development

No branches or pull requests