mirror of
https://github.com/ElectronNET/Electron.NET.git
synced 2026-02-04 05:34:51 +00:00
Issue with @types/socket.io with electronize build #244
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 @hhfranzo on GitHub (Dec 20, 2018).
Originally assigned to: @robertmuehsig on GitHub.
Hi,
I'm experiencing an issue when I try to build the application with "electronize build /target win"
The build fails with the following message:
"Packaging app for platform win32 x64 using electron v3.0.0
Failed to locate module "@types/socket.io" from "."
This normally means that either you have deleted this package already somehow (check your ignore settings if using electron-packager). Or your module installation failed."
Did I miss to install some packages? Note that I already ran "npm install socket.io -g".
Thanks.
@hhfranzo commented on GitHub (Dec 20, 2018):
Forgot to say that I'm using Electron.NET 0.0.10...
@JimmyTheJ commented on GitHub (Dec 20, 2018):
I have been working on this repo for the last couple days as I have had a similar problem since upgrading to Dotnet Core 2.2.
You can fork the repo and change the BuildCommand.cs file for the CLI to do npm install without the --production and that might fix it. I plan on putting in a pull request with some fixes since 0.0.10 release and Dotnet Core 2.2 broke some things at some point soon but not sure exactly when.
@paillave commented on GitHub (Dec 23, 2018):
Here is what is get at the end of the command
electronize build /target winWhat is strange is that the
electronize startcommand works with no problem.@paillave commented on GitHub (Dec 25, 2018):
I found the reason of the bug (it actually seems to be a bug in ElectronNET).
On a fresh project (or at least, a where the folder
obj/desktop/XXXdoesn't exist already), the build with ElectronNET version 0.0.10 can't possibly work.Here is the content of
package.jsonthat will be used to build electron host (the one in the folderobj\desktop\win):dc3eec37bb/ElectronNET.Host/package.json (L11-L21)The problem is that the automatic batch executes an
npm install --productionlike we can see in log and also in the source code of ElectronNET:dc3eec37bb/ElectronNET.CLI/Commands/BuildCommand.cs (L94)The problem is that
--productionargument fornpm installasks npm to ignore what is mentioned in thedevDependenciesnode. That is why electron is lost when trying to make the final build of the application assocket.iotypes are missing for typescript compilation.This
--productionargument has been add by @GregorBiswanger for a big refactoring in the commit524e6c8.I could push a fix, but I can imagine he had a good reason to add this problematic switch as he is involved in this project since the start. It's better he chooses the proper solution for this issue.
@JimmyTheJ commented on GitHub (Dec 26, 2018):
Yeah I ran into this problem too among others recently, so I just forked the repo and fixed it myself for the purposes of the project I'm working on. You can build the CLI .dll and just run a local version of it instead of the globally installed tool.
@paillave commented on GitHub (Dec 26, 2018):
@JimmyTheJ Just saw that you actually mentioned it on a previous post. I didn't understand what you were talking about. I do now :)
@robertmuehsig commented on GitHub (Dec 28, 2018):
@paillave Would #194 help?
@paillave commented on GitHub (Dec 28, 2018):
Thanks @robertmuehsig . According to me, this solves the issue. I'll make an attempt from the moment I'm front of my screen.
@robertmuehsig commented on GitHub (Dec 28, 2018):
Thanks - if you hit any other blocking issues just let me know. I try to push a new version to NuGet.org tomorrow.
Thanks for your patience!
@robertmuehsig commented on GitHub (Dec 30, 2018):
0.0.11 with the fix should be ready on NuGet.org.
Hope this helps!
@paillave commented on GitHub (Dec 31, 2018):
Just tested, works great. Thx!
@hhfranzo commented on GitHub (Jan 9, 2019):
It is still not working under Windows. I just re-installed ElectronNET.CLI and updated the ElectronNET.API in the project (actually I tried with different projects), but I get the same message.
Under Linux (Ubuntu 18.04) I cannot say because I have another issue (with an mvc brand new project). I cannot install electron-package, because it doesn't find package.json.
@Lonka commented on GitHub (Jan 11, 2019):
I updated ElectronNET.CLI (0.0.11) and ElectronNET.API (0.0.11) as same as you, then build the application got the same error message. But I deleted
obj\desktop\winand build again, it's working.