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

Cannot build app behind corporate proxy #858

Open
mu88 opened this issue Jun 17, 2024 · 0 comments
Open

Cannot build app behind corporate proxy #858

mu88 opened this issue Jun 17, 2024 · 0 comments
Labels

Comments

@mu88
Copy link

mu88 commented Jun 17, 2024

Problem description

When trying to build a Electron.NET app on my company laptop behind a corporate proxy, it fails with an npm error although the environment variables HTTP_PROXY and HTTPS_PROXY are set.

Versions

  • Version: 23.6.2
  • .NET: 8.0.300
  • Node.js: 20.8.1
  • Target: Windows (electronize build /target win)

Steps to Reproduce

  1. Clone this repo: https://github.com/mu88/ElectronWebsiteWrapper
  2. Open PowerShell
  3. Run dotnet tool restore
  4. Run dotnet electronize build /target win

Logs

Build Electron Application...
Arguments:
        target = win
Build ASP.NET Core App for win-x64...
Executing dotnet publish in this directory: C:\work\GitHub\ElectronWebsiteWrapper\obj\desktop\win
Build ASP.NET Core App for win-x64 under Release-Configuration...
dotnet publish -r win-x64 -c "Release" --output "C:\work\GitHub\ElectronWebsiteWrapper\obj\desktop\win\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained
dotnet publish -r win-x64 -c "Release" --output "C:\work\GitHub\ElectronWebsiteWrapper\obj\desktop\win\bin" /p:PublishReadyToRun=true /p:PublishSingleFile=true --self-contained
  Determining projects to restore...
  All projects are up-to-date for restore.
C:\Program Files\dotnet\sdk\8.0.300\Current\SolutionFile\ImportAfter\Microsoft.NET.Sdk.Solution.targets(36,5): warning NETSDK1194: The "--output" option isn't supported when building a solution. Specifying a solution-level output path results in all projects copying outputs to the same directory, which can lead to inconsistent builds. [C:\work\GitHub\ElectronWebsiteWrapper\ElectronWebsiteWrapper.sln]
  ElectronWebsiteWrapper -> C:\work\GitHub\ElectronWebsiteWrapper\bin\Release\net8.0\win-x64\ElectronWebsiteWrapper.dll
  ElectronWebsiteWrapper -> C:\work\GitHub\ElectronWebsiteWrapper\obj\desktop\win\bin\


Start npm install...
npm install --production
npm WARN config production Use `--omit=dev` instead.

added 48 packages, and audited 49 packages in 3s

found 0 vulnerabilities


ElectronHostHook handling started...
Build Electron Desktop Application...
Executing electron magic in this directory: C:\work\GitHub\ElectronWebsiteWrapper\bin\desktop
Create electron-builder configuration file...
node build-helper.js electron.manifest.json


Package Electron App for Platform win...
npx electron-builder --config=./bin/electron-builder.json --win --x64 -c.electronVersion=23.2.0
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path C:\Users\myUser\AppData\Roaming\npm
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, lstat 'C:\Users\myUser\AppData\Roaming\npm'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in: C:\Users\myUser\AppData\Local\npm-cache\_logs\2024-06-17T14_35_15_490Z-debug-0.log


... done

Further information

At the very beginning, only the environment variables HTTP_PROXY and HTTPS_PROXY were set on my laptop. This way, npm didn't restore any packages. I had to explicitly run npm config set proxy http://proxy.company.com:1234 to get to the current point.

The problem is not bound to this particular app - it also fails for https://github.com/mu88/BlazorFotoManager.

@mu88 mu88 added the bug label Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant