Cannot find Module 'detect-port' #141

Closed
opened 2026-01-29 16:32:16 +00:00 by claunia · 3 comments
Owner

Originally created by @svelluto on GitHub (Apr 6, 2018).

Originally assigned to: @GregorBiswanger on GitHub.

I just found this project (and Electron in general) and find it could be really great with a legacy application migration we're planning... and we're all .Net developers which makes this even better.

The trouble I have is I'm unable to run an executable on Windows.

I'm able to start the app through dotnet electronize start. that works just fine.
I'm using the command dotnet electronize /target win to generate the executable, and I get prompted with an error: "Cannot find module 'detect-port'". The error has an ok button, and when I click it nothing happens next. Also - the exe remains running which I didn't noticed until I had plenty running.

Thanks.

Originally created by @svelluto on GitHub (Apr 6, 2018). Originally assigned to: @GregorBiswanger on GitHub. I just found this project (and Electron in general) and find it could be really great with a legacy application migration we're planning... and we're all .Net developers which makes this even better. The trouble I have is I'm unable to run an executable on Windows. I'm able to start the app through **dotnet electronize start**. that works just fine. I'm using the command **dotnet electronize /target win** to generate the executable, and I get prompted with an error: "Cannot find module 'detect-port'". The error has an ok button, and when I click it nothing happens next. Also - the exe remains running which I didn't noticed until I had plenty running. Thanks.
claunia added the help wantedquestion labels 2026-01-29 16:32:16 +00:00
Author
Owner

@rayhanhasnat commented on GitHub (Apr 7, 2018):

run 'npm install' in YourProject > bin > desktop > YourProject.Host-win32-x64 > resources > app
That fixed the problem in my case but I'm looking for a better solution

@rayhanhasnat commented on GitHub (Apr 7, 2018): run 'npm install' in YourProject > bin > desktop > YourProject.Host-win32-x64 > resources > app That fixed the problem in my case but I'm looking for a better solution
Author
Owner

@GregorBiswanger commented on GitHub (Apr 14, 2018):

We use in the background the electron-packager.. and I got the same problem with native Electron..
I don´t know what is the best solution here.. we can try to execute "npm install" after the packaging.. but that is a workaround, and I dont think that is a good way..

@GregorBiswanger commented on GitHub (Apr 14, 2018): We use in the background the electron-packager.. and I got the same problem with native Electron.. I don´t know what is the best solution here.. we can try to execute "npm install" after the packaging.. but that is a workaround, and I dont think that is a good way..
Author
Owner

@pookdeveloper commented on GitHub (Oct 4, 2021):

Same problem here

@pookdeveloper commented on GitHub (Oct 4, 2021): Same problem here
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#141