nodegui: The specified module could not be found

Describe the bug When running the example/starter code for nodegui, I get the error:

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

Error: The specified module could not be found.
\\?\C:\Users\Max\Documents\stuff of max\node.js stuff\d-and-d-spells-database\node_modules\@nodegui\nodegui\build\Release\nodegui_core.node
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1226:18)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)
    at Module.require (internal/modules/cjs/loader.js:1080:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (C:\Users\Max\Documents\stuff of max\node.js stuff\d-and-d-spells-database\node_modules\@nodegui\nodegui\dist\lib\utils\addon.js:3:15)
    at Module._compile (internal/modules/cjs/loader.js:1176:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1196:10)
    at Module.load (internal/modules/cjs/loader.js:1040:32)
    at Function.Module._load (internal/modules/cjs/loader.js:929:14)

The code I’m using (in a file called index.js):

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

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

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

I run it with qode index.js. Maybe because it was compiled with the wrong version of npm or something?? I have no idea. Please help me. Thanks.

Desktop :

  • OS: Windows 10
  • NodeGUI version: the latest I guess, installed it with npm install @nodegui/nodegui
  • NPM version: 6.14.5
  • Node version: 12.13.1
  • Qode version: 14.2.0

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 16

Most upvoted comments

Huh ok. I created an npm script called start that just runs the command qode index.js. The app opens and everything works. I’m very confused. Why would this have any effect on the problem?

#937 This may be helpful to someone.