【问题标题】:NodeJS nodegui module could not be found找不到NodeJS nodegui模块
【发布时间】:2020-09-21 23:10:00
【问题描述】:

试图让nodegui 在一个空白的 nodeJS 项目上运行,但它不会运行。示例 starter-project 运行良好,但是我不想在我的项目中使用 webpack。

运行node main.js时出错:

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

main.js:

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

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

global.win = win;

运行npm install @nodegui/nodeguithis是输出。

Windows 10 x64 build 18363,NodeJS 版本 12.16.1,NPM 版本 6.14.2,NodeGUI 版本 0.16.0

【问题讨论】:

  • 你找到答案了吗?
  • 是的,但我不知道它是什么

标签: node.js node-modules


【解决方案1】:

您需要运行的项目中似乎缺少指定的模块

npm i --save 指定

【讨论】:

  • 这并不能解决问题,我不相信它指的是一个名为specified的实际模块
猜你喜欢
  • 2017-12-16
  • 2014-01-29
  • 1970-01-01
  • 2016-03-15
  • 1970-01-01
  • 1970-01-01
  • 2021-08-22
  • 2013-12-25
  • 2016-08-04
相关资源
最近更新 更多