Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compiling Error with node-gyp on Win10x64 and Electron #16

Open
Ironcheese opened this issue Jun 6, 2016 · 3 comments
Open

Compiling Error with node-gyp on Win10x64 and Electron #16

Ironcheese opened this issue Jun 6, 2016 · 3 comments

Comments

@Ironcheese
Copy link

I am trying to get font-manager installed with electron.

Current System Setup:

  • Windows 10 x64
  • nodejs v6.2.0
  • npm 3.9.6
  • Visual Studio 2015 Community (With C++)

Following output is generated when run "install font-manager"

`electron-quick-start master > $ npm install font-manager

[email protected] install Q:\workspace\ALEXANDER\electron\electron-quick-start\node_modules\font-manager
node-gyp rebuild

Q:\workspace\ALEXANDER\electron\electron-quick-start\node_modules\font-manager>if not defined npm_config_node_gyp (node
"C:\Users\Alex\AppData\Local\scoop\apps\nodejs\6.2.0\nodejs\node_modules\npm\bin\node-gyp-bin....\node_modules\node-g
yp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Die Projekte in dieser Projektmappe werden nacheinander erstellt. Um eine parallele Erstellung zu ermöglichen, müssen Sie den Schalter "/m" hinzufügen.
FontManager.cc
FontManagerWindows.cc
..\src\FontManagerWindows.cc(462): warning C4267: "Argument": Konvertierung von "size_t" nach "UINT32", Datenverlust möglich [Q:\workspace\ALEXANDER\electron\electron-quick-start\node_modules\font-manager\build\fontmanager.vcxproj]
q:\workspace\alexander\electron\electron-quick-start\node_modules\nan\nan_new.h(208): warning C4267: "Argument": Konvertierung von "size_t" nach "int", Datenverlust möglich (Quelldatei wird kompiliert ..\src\FontManager.cc) [Q:\workspace
ALEXANDER\electron\electron-quick-start\node_modules\font-manager\build\fontmanager.vcxproj]
..\src\FontManager.cc(19): note: Siehe Verweis auf die Instanziierung der gerade kompilierten Funktions-template "v8: :Localv8::Array Nan::New<v8::Array,unsigned __int64>(A0)".
with
[
A0=unsigned __int64
]
win_delay_load_hook.c
Bibliothek "Q:\workspace\ALEXANDER\electron\electron-quick-start\node_modules\font-manager\build\Release\fontmanag
er.lib" und Objekt "Q:\workspace\ALEXANDER\electron\electron-quick-start\node_modules\font-manager\build\Release\font
manager.exp" werden erstellt.
Code wird generiert.
Codegenerierung ist abgeschlossen.
fontmanager.vcxproj -> Q:\workspace\ALEXANDER\electron\electron-quick-start\node_modules\font-manager\build\Release
fontmanager.node
[email protected] Q:\workspace\ALEXANDER\electron\electron-quick-start
-- [email protected] extraneous

If I then start electron via "npm start" the dev tools log:

ELECTRON_ASAR.js:158 Uncaught Error: Eine DLL-Initialisierungsroutine ist fehlgeschlagen. \\?\Q:\workspace\ALEXANDER\electron\electron-quick-start\node_modules\font-manager\build\Release\fontmanager.node

Is this a node-gyp issue? Or am I missing something?

@ghost
Copy link

ghost commented Dec 27, 2016

I know I'm pretty late to the party but I ran into this today. For others coming here with the same issue, you need to use something like electron-rebuild to get native modules working ( see: http://electron.atom.io/docs/tutorial/using-native-node-modules ) and is not a problem exclusive to font-manager.

What I did to get font-manager working in my electron app:

  1. Install electron-rebuild as a dev dependency (npm install --save-dev electron-rebuild)
  2. Create a postinstall script that runs electron-rebuild ("scripts": { "postinstall": "electron-rebuild" }})
  3. Install font-manager (npm install --save font-manager)
  4. Run postinstall script (npm run-script postinstall)
  5. At this point, you may get an error that the cleanup task failed because it couldn't unlink a file. Simply delete the offending file manually and you'll be able to run postinstall again.
  6. After electron-rebuild successfully runs, everything should be good to go.

@rBurgett
Copy link
Contributor

rBurgett commented Jan 4, 2017

I eventually gave up on native font modules. With each change in Node/Chromium everything would break all over again. It was taking too much of my time, so I made a package which uses pure JavaScript. It's currently being used in a production application around the world without issue.

If you're interested: https://www.npmjs.com/package/system-font-families

@stevebauman
Copy link

Thanks @rBurgett!! Your package works great in my electron project. Really appreciate your work 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants