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

Installs but doesn't run Windows 10 x64 #448

Closed
CrimsonVex opened this issue Mar 16, 2020 · 3 comments
Closed

Installs but doesn't run Windows 10 x64 #448

CrimsonVex opened this issue Mar 16, 2020 · 3 comments

Comments

@CrimsonVex
Copy link

CrimsonVex commented Mar 16, 2020

The example starter project runs fine, but I do not want to use webpack for my own project. So in my project, after running npm i @nodegui/nodegui (log here), when I try to run my project using node index.js I get this error:

internal/modules/cjs/loader.js:1208
  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified module could not be found.
\\?\C:\Users\user\Documents\project\node_modules\@nodegui\nodegui\build\Release\nodegui_core.node
�[90m    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1208:18)�[39m
�[90m    at Module.load (internal/modules/cjs/loader.js:1002:32)�[39m
�[90m    at Function.Module._load (internal/modules/cjs/loader.js:901:14)�[39m
�[90m    at Module.require (internal/modules/cjs/loader.js:1044:19)�[39m
�[90m    at require (internal/modules/cjs/helpers.js:77:18)�[39m
    at Object.<anonymous> (C:\Users\user\Documents\project\node_modules\�[4m@nodegui�[24m\nodegui\dist\lib\utils\addon.js:3:15)
�[90m    at Module._compile (internal/modules/cjs/loader.js:1158:30)�[39m
�[90m    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1178:10)�[39m
�[90m    at Module.load (internal/modules/cjs/loader.js:1002:32)�[39m
�[90m    at Function.Module._load (internal/modules/cjs/loader.js:901:14)�[39m

The code I'm running:

const { QMainWindow } = require("@nodegui/nodegui");

const win = new QMainWindow();
win.show();

global.win = win;

Desktop (please complete the following information):

  • OS: Windows 10 x64 build 18363
  • NodeGUI version 0.16.0
@a7ul
Copy link
Collaborator

a7ul commented Mar 16, 2020

Hi
The erroor looks like the native module for nodegui didnt build correctly.

You can either
re-install the @nodegui/nodegui after deleteing node_modules

or

cd node_modules/@nodegui/nodegui
npm run build:addon

This will build the nodegui_core.node native addon file. @Sasstraliss

Although your logs do show that it was built correctly.

Secondly,
you are supposed to use @nodegui/qode to run the project instead of node.

So you should replace node index.js with qode index.js

@Solant
Copy link
Contributor

Solant commented Mar 16, 2020

I had the same issue on win10, nodegui/packer#35

TLDR: just update visual c redistributable to the latest version here https://support.microsoft.com/en-us/help/2977003/the-latest-supported-visual-c-downloads

update: I used visual c++ redistributable 2019 to fix this issue, so you can use the same version

@JeffMII
Copy link

JeffMII commented Apr 30, 2022

#937 I posted a new issue with this answer to hopefully help people on Windows

This post is a couple years old so maybe my solution doesn't apply to this instance, but I was getting the same error after installing nodegui and tried to simply run:

import gui from '@nodegui/nodegui'

const win = new gui.QMainWindow()
win.show()

global.win = win

The solution I found was to run npx qode index.js. I was initially running node index.js and then I found out I needed to run qode index.js but qode isn't recognized, so I tried npx qode index.js and it worked. Hope this helps someone.

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

4 participants