denoland / deno

A modern runtime for JavaScript and TypeScript.
https://deno.com
MIT License
98k stars 5.39k forks source link

deno vscode installation and downloads behind a coporate proxy #26935

Open kraabrsg opened 2 days ago

kraabrsg commented 2 days ago

Version: Deno x2.0.5

Hi,

sorry if i missed an issue.... We have a node project where we build several js files to run on a RHEL Linux.

The idea is to use deno to build native executeable files via crosscompile.

Now it seems as if deno could not do anything which needs to fetch files e.g.deno install and deno info wants do download from registry.npmjs.org but stucks without doing anything.

I had a phone call with colleague responsible for proxy configuration and told me for which certificate i need to use on my pc to bypass issues like "local certificate errors" .

so i added the .crt file with a deno setting deno.tlsCertificate in the project and also for node via cafile=xxx in npm settings file.

Denos output:

tarting Deno language server...
  version: 2.0.5 (release, x86_64-pc-windows-msvc)
  executable: C:\mypath\deno\deno.EXE
Connected to "Visual Studio Code" 1.94.2
Enabling import suggestions for: https://deno.land
  Error fetching registry config for "https://deno.land": EOF while parsing a value at line 1 column 0
Refreshing configuration tree...
  Resolved Deno configuration file: "file:///C:/mypath1/deno.json"
  Resolved package.json: "file:///C:/mypath1/package.json"
  Resolved .npmrc: "C:\Users\myuser\.npmrc"
Could not set npm package requirements: Error getting response at http://registry.npmjs.org/axios for package "axios": An npm specifier not found in cache: "axios", --cached-only is specified.
Could not set npm package requirements: Error getting response at http://registry.npmjs.org/axios for package "axios": An npm specifier not found in cache: "axios", --cached-only is specified.
Server ready.
.....
Download http://registry.npmjs.org/pg-promise
successfully cancelled request with ID: 652
Download http://registry.npmjs.org/@types%2fnode
Download http://registry.npmjs.org/@types%2fpg
Download http://registry.npmjs.org/@types%2fpg-promise
Download http://registry.npmjs.org/@typescript-eslint%2feslint-plugin
Download http://registry.npmjs.org/@typescript-eslint%2fparser
Download http://registry.npmjs.org/axios
Download http://registry.npmjs.org/ebcdic-ascii
Download http://registry.npmjs.org/basic-ftp
Download http://registry.npmjs.org/esbuild
Download http://registry.npmjs.org/fast-xml-parser
Download http://registry.npmjs.org/esbuild-node-externals
Download http://registry.npmjs.org/ftp-ts
Download http://registry.npmjs.org/memorystream
Download http://registry.npmjs.org/node-sql-parser
Download http://registry.npmjs.org/pg
Download http://registry.npmjs.org/ts-node
Download http://registry.npmjs.org/pg-promise
...
Could not set npm package requirements: Error getting response at http://registry.npmjs.org/@types%2fnode for package "@types/node": An npm specifier not found in cache: "@types/node", --cached-only is specified.
Could not set npm package requirements: Error getting response at http://registry.npmjs.org/@types%2fnode for package "@types/node": An npm specifier not found in cache: "@types/node", --cached-only is specified.
Error caching: Error getting response at http://registry.npmjs.org/@types%2fnode for package "@types/node": error sending request for url (https://registry.npmjs.org/@types%2Fnode): client error (Connect): tcp connect error: Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat. (os error 10060): Ein Verbindungsversuch ist fehlgeschlagen, da die Gegenstelle nach einer bestimmten Zeitspanne nicht richtig reagiert hat, oder die hergestellte Verbindung war fehlerhaft, da der verbundene Host nicht reagiert hat. (os error 10060)

Terminal output stuck:

Download ⣟ [10:36] 0/18
 - http://registry.npmjs.org/@types%2fnode
 - http://registry.npmjs.org/@types%2fpg
 - http://registry.npmjs.org/@types%2fpg-promise
 - http://registry.npmjs.org/@typescript-eslint%2feslint-plugin

package.json

    "devDependencies": {
        "@types/node": "^20.11.20",
        "@types/pg": "^8.11.10",
        "@types/pg-promise": "^5.4.3",
               ...
      },
    "dependencies": {
               ...
        "pg": "^8.13.1",
        "pg-promise": "^11.10.1"
    }

So i am not sure if there is a problem with proxy(is there a checklist or something like that somewhere) , or a misconfiguration in the package.json ?

Thanks!

kraabrsg commented 1 day ago

So after further research the os error 10060 is because it is blocked by the coporate firewall ( a proxy is not used here).

After talking to firewall colleaugue he informed me that there is an ip addy that is blocked because of malware infections (not sure if its from jsr.io or dl.deno.land or deno.land) https://www.virustotal.com/gui/ip-address/34.149.100.209

Which is really bad because i doubt that they will open this...

1.) The stuck download is because the coporare proxy gets a 301, is there a way to avoid that ? 2.) is there a way to say deno to use our corporate proxy, because it seems that some of theses requests are not going via our proxy, but direct instead

In Settings.json:

    "http.proxy": "http://myproxy:8080",
    "deno.certificateStores": ["system"],

Even when starting a deno project from scratch, using deno init add depencies in deno.json and do deno install with only depencies from denos std it does not work...

Thanks!

bartlomieju commented 9 hours ago

@nayeemrmn PTAL, I think we might not be respecting some settings here?

nayeemrmn commented 7 hours ago

@kraabrsg Use "deno.env": { "HTTP_PROXY": "http://myproxy:8080" } instead for now. I don't remember what the situation was for http.proxy, if and why we don't support it..

kraabrsg commented 1 hour ago

Hi @bartlomieju , @nayeemrmn thanks for getting back on this, but this does not seem to make a difference.

image

I tried deno install

image

Deno Version: 2.1.0

One big Problem (even if this solution would work) is the ip above which is on a black list https://www.virustotal.com/gui/ip-address/34.149.100.209

I have to ask again with our firewall colleaugue to look if something has changed, but seems not... Any further ideas to track this down ?

Btw. deno looks really awesome, it would be a pitty if we could not use this...