brunolm / nvm

nvm for Windows
6 stars 1 forks source link

power-nvm on docker #4

Open janstadt opened 5 years ago

janstadt commented 5 years ago

Attempting to install nvm on a windows docker image and when i call nvm install 10.15.3 I get the following response:

Invoke-WebRequest : The response content cannot be parsed because the Internet
Explorer engine is not available, or Internet Explorer's first-launch
configuration is not complete. Specify the UseBasicParsing parameter and try
again.
At C:\Program
Files\WindowsPowerShell\Modules\power-nvm\1.0.3\power-nvm.psm1:200 char:17
+ ... $versions = Invoke-WebRequest -Uri https://nodejs.org/dist/index.json ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo          : NotImplemented: (:) [Invoke-WebRequest], NotSupp
   ortedException
    + FullyQualifiedErrorId : WebCmdletIEDomNotSupportedException,Microsoft.Po
   werShell.Commands.InvokeWebRequestCommand

Please add -UseBasicParsing here: https://github.com/brunolm/nvm/blob/master/src/power-nvm.psm1#L200 so that fresh installs will not error out.

More info here: https://stackoverflow.com/questions/38005341/the-response-content-cannot-be-parsed-because-the-internet-explorer-engine-is-no

brunolm commented 5 years ago

Let me know if this works out https://github.com/brunolm/nvm/commit/00df176782268a4a882dea17555deeff4790a0e2

Version 1.1.0 https://www.powershellgallery.com/packages/power-nvm/1.1.0