node.js - 找不到 NodeJS nodegui 模块

正在尝试获取 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

主要.js:

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

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

global.win = win;

运行 npm install @nodegui/nodegui 时 this是输出。

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

最佳答案

npx qode main.js

npm exec qode main.js

https://stackoverflow.com/questions/60700095/

相关文章:

javascript - Vue CLI - 未找到 PostCSS 配置

c++ - 这是带有 std::any 或 std::is_copy_constructible 的

python - 加载模型时没有 GPU 的机器上的 Cuda 驱动程序错误

react-native - React Native 风格 textDecorationLine

image - Flutter web Image.network旋转图片

npm - 错误 : pngquant failed to build, 确保安装了 libpng-

reactjs - 在 react-testing-library 中使用 getByRole 按可

typescript - 如何在 WebStorm/IntelliJ 中使用 ts-node 导入项

c# - 使用 C# Windows 10 是否可以判断视频/相机当前是否被任何应用程序使用?

tensorflow - 转换后的 Tensorflow JS 模型报告缺少输入形状