mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-03 21:25:13 +00:00
How to use require('request') in Electron.NET #552
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @Hisaack on GitHub (Aug 17, 2020).
Originally assigned to: @GregorBiswanger on GitHub.
Hi everyone, I have ASP CORE Project and I have installed this package of Electron API and it is working fine. I want to add request module but I keep on getting error

I have tried to install the package through
npm install request --saveon cmd I opened on my project folder but still it does not work.This is my full codes
@GregorBiswanger commented on GitHub (Aug 17, 2020):
Are you using this with the HostHook feature?
Can you provide a sample project?
@Hisaack commented on GitHub (Aug 17, 2020):
Am not using HostHook feature. Sure let me compile and push it to the github
And btw, my Asp Core project is using version 3.0
@GregorBiswanger commented on GitHub (Aug 17, 2020):
okay, the problem is, you want to use require within html with javascript (renderer process). You should use the HostHook feature for your own node module packages. Download the API demo app and take a look at the "Execute your own TypeScript code" part.
https://github.com/ElectronNET/electron.net-api-demos/releases/tag/v5.22.13
https://github.com/ElectronNET/electron.net-api-demos
@Hisaack commented on GitHub (Aug 17, 2020):
Okay, Let me try, and by the way do Electron.NET Api supports the downloading feature? I wanna download a file from the server and update the progress bar on status progress. I can't see this feature available.
@GregorBiswanger commented on GitHub (Aug 17, 2020):
See that solution for you: How to download a file in ASP.NET Core
@Hisaack commented on GitHub (Aug 17, 2020):
When I try to add hosthook on command CLI, it refuses. I used this command

electronize add hosthook@GregorBiswanger commented on GitHub (Aug 17, 2020):
Use the command for one time in your project folder... that creates a ElectronHost folder in your project with package.json.. into this use the
npm install request. by the way... the best is here to use the native asp.net core download features... use only the Host Hook feature for native JavaScript/TypeScript code with node.js..@Hisaack commented on GitHub (Aug 17, 2020):
Am sorry again, am trying to invoke this command
dotnet electronize add hosthookorelectronize add hosthookto create ElectronHost folder and it is not working. Is there anything am missing, yes this is my first time am trying to execute this command.@Hisaack commented on GitHub (Aug 17, 2020):
This is what am describing here. I dont know why it does not recognize this command. It says
unknown command add@GregorBiswanger commented on GitHub (Aug 17, 2020):
Use the command in your project and use the Electron.NET CLI and API with Version 7.30.2 for .NET Core 3.0 Support.
@GregorBiswanger commented on GitHub (Oct 25, 2020):
Did you solve the problem?
@GregorBiswanger commented on GitHub (Mar 28, 2023):
🎉🚀 New Electron.NET version 23.6.1 released 🚀🎉
With native Electron 23 and .NET 6 support. Your problem should be fixed here. If you continue to have the problem, please let us know. Please note the correct updating of your API & CLI. Info in the README. Have fun!