Cannot build app behind corporate proxy #957

Closed
opened 2026-01-29 16:52:44 +00:00 by claunia · 1 comment
Owner

Originally created by @mu88 on GitHub (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.

Originally created by @mu88 on GitHub (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.
claunia added the bug label 2026-01-29 16:52:44 +00:00
Author
Owner

@FlorianRappl commented on GitHub (Oct 31, 2025):

Outdated - use ElectronNET.Core and ElectronNET.Core.AspNet.

See Wiki / What's New.

@FlorianRappl commented on GitHub (Oct 31, 2025): Outdated - use `ElectronNET.Core` and `ElectronNET.Core.AspNet`. See [Wiki / What's New](https://github.com/ElectronNET/Electron.NET/wiki/What's-New).
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#957