NodeGUI program won't compile, even if I copy-pasted it from the official docs

Viewed 9

I am trying to learn NodeGUI, but the program never runs, and always compiles an error. I have tried to search for the error online but have failed to get a solution. I get the following error:

  return process.dlopen(module, path.toNamespacedPath(filename));
                 ^

Error: The specified module could not be found.
\\?\E:\Coding\JavaScript\NodeGUI\node_modules\@nodegui\nodegui\build\Release\nodegui_core.node
←[90m    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1183:18)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:975:32)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m
←[90m    at Module.require (node:internal/modules/cjs/loader:999:19)←[39m
←[90m    at require (node:internal/modules/cjs/helpers:102:18)←[39m
    at Object.<anonymous> (E:\Coding\JavaScript\NodeGUI\node_modules\←[4m@nodegui←[24m\nodegui\dist\lib\utils\addon.js:3:15)
←[90m    at Module._compile (node:internal/modules/cjs/loader:1099:14)←[39m
←[90m    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)←[39m
←[90m    at Module.load (node:internal/modules/cjs/loader:975:32)←[39m
←[90m    at Function.Module._load (node:internal/modules/cjs/loader:822:12)←[39m {
  code: ←[32m'ERR_DLOPEN_FAILED'←[39m
}

Node.js v17.8.0

I then tried to clone the hello world project for NodeGUI, and it worked without any error. My JS File Code(main.js):

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

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

global.win = win; // To prevent win from being garbage collected.

Am I doing something wrong, or do I need to download Qt manually to my PC?

I have downloaded, deleted, and reinstalled @nodegui/nodegui using NPM many times, and it doesn't work.

0 Answers
Related