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

Fail to install last version on windows 64 behind proxy #1382

Closed
emerxom opened this issue Jun 17, 2021 · 12 comments · Fixed by #1621
Closed

Fail to install last version on windows 64 behind proxy #1382

emerxom opened this issue Jun 17, 2021 · 12 comments · Fixed by #1621

Comments

@emerxom
Copy link

emerxom commented Jun 17, 2021

last version

npm install esbuild
npm ERR! code 1
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node install.js
npm ERR! Trying to install "esbuild-windows-64" using npm
npm ERR! Failed to install "esbuild-windows-64" using npm: Command failed: npm install --loglevel=error --prefer-offline --no-audit --progress=false [email protected]
npm ERR! npm ERR! code ETARGET
npm ERR! npm ERR! notarget No matching version found for [email protected].
npm ERR! npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! npm ERR! notarget a package version that doesn't exist.
npm ERR!
npm ERR!
npm ERR! Trying to download "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.12.9.tgz"
npm ERR! Failed to download "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.12.9.tgz": unable to get local issuer certificate
npm ERR! Install unsuccessful

previous one

npm install [email protected]
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
@evanw
Copy link
Owner

evanw commented Jun 17, 2021

Successfully-downloaded versions are cached locally, so it's not surprising if a previously-installed version can be installed successfully even if the network isn't working. That just means it's already cached.

You can find the cached versions in %LocalAppData%\Cache\esbuild\bin and you can delete these cached versions if you want to test re-downloading those versions over the network.

I don't think I can help you debug your proxy setup, however.

@emerxom
Copy link
Author

emerxom commented Jun 18, 2021

Thanks for he tip.
I deleted the cached version, but the outcome didn't changed. 😅

@mc-petry
Copy link

mc-petry commented Aug 2, 2021

I have a similar problem with proxy when running postinstall script:

image

@mc-petry
Copy link

mc-petry commented Aug 2, 2021

I've checked. Previous version 0.12.15 works well:
image
and 0.12.16 and 0.12.17 has a trouble

@woppa684
Copy link

woppa684 commented Aug 9, 2021

Probably related issue here:

> [email protected] postinstall C:\Repos\myrepo\node_modules\esbuild
> node install.js

Trying to install "esbuild-windows-64" using npm
Failed to install "esbuild-windows-64" using npm: Command failed: npm install --loglevel=error --prefer-offline --no-audit --progress=false [email protected]
npm ERR! code E401
npm ERR! Unable to authenticate, need: Basic realm="http://ourcorporateregistry", Negotiate, NTLM

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\myuser\AppData\Roaming\npm-cache\_logs\2021-08-09T05_52_58_429Z-debug.log

Trying to download "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.12.17.tgz"
Failed to download "https://registry.npmjs.org/esbuild-windows-64/-/esbuild-windows-64-0.12.17.tgz": connect ECONNREFUSED 104.16.22.35:443

Our company uses a private registry that acts as a proxy that uses the NPM registry as an upstream source. The postinstall script doesn't respect my local .npmrc file that configures this proxy and token. It might be worth mentioning that our registry settings are per project (since we use different ones for different projects) and that when running the install script from esbuild it uses the global .npmrc file and not the one located a few folders higher (in the root of the project). Probably this is indeed what it's supposed to do, but I see no workaround for this.

@ChristophRSG
Copy link

@evanw We have the same problem as @woppa684 ; we have a private registry that uses the NPM registry as upstream source and the postinstall script doesn't respect the .npmrc file.

So the "unactionable" tag would not be correct IMHO.

@bodrick
Copy link

bodrick commented Aug 18, 2021

So I created a powershell script to download and save to cache.
Here is the Gist

@evanw
Copy link
Owner

evanw commented Aug 18, 2021

So the "unactionable" tag would not be correct IMHO.

Unactionable doesn't mean it's not a bug. It just means it doesn't have a self-contained way for me to reproduce this (code to run and/or instructions to follow), so it's not currently possible to investigate and fix. Once we have that it's likely possible to fix the problem.

@ChristophRSG
Copy link

@evanw It should be possible to reproduce this by adding any address as the registry in the .npmrc file since the setting is not respected by esbuild.

e.g.:

registry=https://www.example.com

@ChristophRSG
Copy link

ChristophRSG commented Aug 31, 2021

Update from our side:

Adding the registry in our global npm / yarn config solved the issue for us. :)

Thank you for your work @evanw 👍

@mc-petry
Copy link

For me helped to set npm proxy in that way:

npm config set registry http://registry.npmjs.org/
npm config set http-proxy http://address:port
npm config set https-proxy http://address:port
npm config set proxy http://address:port
npm set strict-ssl false

Maybe some of this is unnecessary

@marcotaubmann
Copy link

Got the error when running npm install on a newly initialized SvelteKit app. yarn install worked.

Maybe this helps someone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants