Must electron packer be globally installed? #64

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

Originally created by @robertmuehsig on GitHub (Nov 12, 2017).

Originally assigned to: @GregorBiswanger on GitHub.

From this comment

You say

"Be aweare that dotnet electonize build require that the electron packer is installed globally via npm."
Using of global node modules is not very good idea. User should not be able to run commands as root.
For what purpose u use global node modules? Just because u can do it?
Can u just use node_modules folder from project?

Currently we assume that electron packer is installed globally and under Windows we even just install it globally.

From the electron packer page:

This module requires Node.js 4.0 or higher to run.

for use in npm scripts

npm install electron-packager --save-dev

for use from cli

npm install electron-packager -g

The question is: Is this needed? I'm not sure, maybe @GregorBiswanger knows more.

Originally created by @robertmuehsig on GitHub (Nov 12, 2017). Originally assigned to: @GregorBiswanger on GitHub. From this [comment](https://github.com/ElectronNET/Electron.NET/issues/36#issuecomment-343642402) > You say > "Be aweare that dotnet electonize build require that the electron packer is installed globally via npm." > Using of global node modules is not very good idea. User should not be able to run commands as root. > For what purpose u use global node modules? Just because u can do it? > Can u just use node_modules folder from project? Currently we assume that electron packer is installed globally and under Windows we even just install it globally. From the electron packer [page](https://github.com/electron-userland/electron-packager): > This module requires Node.js 4.0 or higher to run. > # for use in npm scripts > npm install electron-packager --save-dev > # for use from cli > npm install electron-packager -g The question is: Is this needed? I'm not sure, maybe @GregorBiswanger knows more.
claunia added the question label 2026-01-29 16:29:40 +00:00
Author
Owner

@GregorBiswanger commented on GitHub (Nov 13, 2017):

The electron packer build our Electron.Host project with its own node_modules to the executible electron app. When you install the electron packer into the Electron.Host, your electron app has an unnecessary library. The problem is, you get a bigger file size of your application.

One alternative is, to install this to your ASP.NET Core project. But I dont know, if the people would like a node_modules folder in their ASP.NET project.

@GregorBiswanger commented on GitHub (Nov 13, 2017): The **electron packer** build our Electron.Host project with its own node_modules to the executible electron app. When you install the electron packer into the Electron.Host, your electron app has an unnecessary library. The problem is, you get a bigger file size of your application. One alternative is, to install this to your ASP.NET Core project. But I dont know, if the people would like a node_modules folder in their ASP.NET project.
Author
Owner

@robertmuehsig commented on GitHub (Nov 13, 2017):

So, this line is needed:

 ProcessHelper.CmdExecute("npm install electron-packager --global", tempPath);

and we can't use:

 ProcessHelper.CmdExecute("npm install electron-packager", tempPath);

right?

@robertmuehsig commented on GitHub (Nov 13, 2017): So, this [line](https://github.com/ElectronNET/Electron.NET/blob/master/ElectronNET.CLI/Commands/BuildCommand.cs#L64) is needed: ProcessHelper.CmdExecute("npm install electron-packager --global", tempPath); and we can't use: ProcessHelper.CmdExecute("npm install electron-packager", tempPath); right?
Author
Owner

@GregorBiswanger commented on GitHub (Nov 15, 2017):

Mhhh.. we can use the tempPath (Obj folder?).. but we need a own package.json, not from the ElectronNET.Host...

@GregorBiswanger commented on GitHub (Nov 15, 2017): Mhhh.. we can use the tempPath (Obj folder?).. but we need a own package.json, not from the ElectronNET.Host...
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/Electron.NET#64