NW-Builder-NWJS Win64使用NW-Builder构建的应用程序不运行我的代码,仅显示默认的NWJS Splash屏幕

发布于 2025-02-03 18:22:35 字数 2162 浏览 2 评论 0原文

我正在尝试为Win64构建我的第一个NWJS应用程序。我正在使用MacOS 10.13.6。在艰难的启动和更新NPM和节点之后,我终于运行了一个构建,该构建没有错误。我将应用程序软件包下载到Windows计算机上,但是当我运行.EXE文件时,该应用程序打开显示NWJS Splash屏幕,而不是加载代码。有什么想法吗?

我正在运行的根目录:

10:50:50 : ~/ReolinkNWJS
ls
dist            icons           javascript      package-lock.json   package.json.TEMPLATE   src
html            images          node_modules        package.json        resources       styles

执行构建:

10:51:01 : ~/ReolinkNWJS
npm run prod

> [email protected] prod
> nwbuild --platforms win64 --buildDir dist/ ./

Latest Version: v0.65.0
Using v0.65.0 (sdk)
Create cache folder in /Users/kevin/ReolinkNWJS/node_modules/nw-builder/cache/0.65.0-sdk
Using cache for: win64
Create release folder in /Users/kevin/ReolinkNWJS/dist/ReolinkNWJS/win64

结果Win32目录:

12:47:48 : ~/ReolinkNWJS
ls dist/ReolinkNWJS/win32
ReolinkNWJS.exe     d3dcompiler_47.dll  icudtl.dat      locales         notification_helper.exe nw_200_percent.pak  payload.exe     swiftshader     vk_swiftshader_icd.json
chromedriver.exe    debug.log       libEGL.dll      nacl_irt_x86_64.nexe    nw.dll          nw_elf.dll      pnacl           v8_context_snapshot.bin vulkan-1.dll
credits.html        ffmpeg.dll      libGLESv2.dll       node.dll        nw_100_percent.pak  nwjc.exe        resources.pak       vk_swiftshader.dll

我将完整的Win64目录下载到Windows Machine,然后执行了包含的Reolinknwjs.exe文件。正如我所说的,我只有NWJS默认的启动屏幕,而不是我的应用程序。

package.json:

{
  "name": "ReolinkNWJS",
  "description": "Reolink Client App In NWJS Framework",
  "version": "0.0.1",
  "icon": "icons/app.icns",
  "main": "html/main.html",
  "chromium-args": "--enable-logging=stderr --enable-spell-checking",
  "window": {
    "toolbar": false,
    "width": 800,
    "height": 500,
    "position": "center"
  },
  "nodejs": true,
  "scripts": {
    "prod": "nwbuild --platforms win64 --buildDir dist/ ./"
  },
  "devDependencies": {
    "nw": "^0.12.0",
    "nw-builder": "^3.7.0"
  }
}

I am attempting to build my first NWJS app for win64. I'm using MacOS 10.13.6 . After a rough start and updating npm and node, I finally ran a build which completed without errors. I downloaded the app package to my Windows machine, however when I run the .exe file, the app opens displaying the NWJS splash screen, instead of loading my code. Any ideas?

Root directory I'm running in:

10:50:50 : ~/ReolinkNWJS
ls
dist            icons           javascript      package-lock.json   package.json.TEMPLATE   src
html            images          node_modules        package.json        resources       styles

Do the build:

10:51:01 : ~/ReolinkNWJS
npm run prod

> [email protected] prod
> nwbuild --platforms win64 --buildDir dist/ ./

Latest Version: v0.65.0
Using v0.65.0 (sdk)
Create cache folder in /Users/kevin/ReolinkNWJS/node_modules/nw-builder/cache/0.65.0-sdk
Using cache for: win64
Create release folder in /Users/kevin/ReolinkNWJS/dist/ReolinkNWJS/win64

Resulting win32 directory:

12:47:48 : ~/ReolinkNWJS
ls dist/ReolinkNWJS/win32
ReolinkNWJS.exe     d3dcompiler_47.dll  icudtl.dat      locales         notification_helper.exe nw_200_percent.pak  payload.exe     swiftshader     vk_swiftshader_icd.json
chromedriver.exe    debug.log       libEGL.dll      nacl_irt_x86_64.nexe    nw.dll          nw_elf.dll      pnacl           v8_context_snapshot.bin vulkan-1.dll
credits.html        ffmpeg.dll      libGLESv2.dll       node.dll        nw_100_percent.pak  nwjc.exe        resources.pak       vk_swiftshader.dll

I downloaded the complete win64 directory to my Windows machine, then executed the containing ReolinkNWJS.exe file. As I stated, I only got the NWJS default splash screen, not my app.

package.json:

{
  "name": "ReolinkNWJS",
  "description": "Reolink Client App In NWJS Framework",
  "version": "0.0.1",
  "icon": "icons/app.icns",
  "main": "html/main.html",
  "chromium-args": "--enable-logging=stderr --enable-spell-checking",
  "window": {
    "toolbar": false,
    "width": 800,
    "height": 500,
    "position": "center"
  },
  "nodejs": true,
  "scripts": {
    "prod": "nwbuild --platforms win64 --buildDir dist/ ./"
  },
  "devDependencies": {
    "nw": "^0.12.0",
    "nw-builder": "^3.7.0"
  }
}

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏天碎花小短裙 2025-02-10 18:22:35

对于NWBuild的部分:

nwbuild --platforms win64 --buildDir dist/ ./

添加以下风味可以解决问题:

--mode build

for nwbuild part:

nwbuild --platforms win64 --buildDir dist/ ./

add in the flavour below may solve the issue:

--mode build
终难愈 2025-02-10 18:22:35

这可能与您遇到的问题有关,因为您都在使用葡萄酒: https://github.com/nwutils/nw-builder/pull/pull/572#issuecomment-11444416689

This might be related to the issue you're encountering, since you're both using WINE: https://github.com/nwutils/nw-builder/pull/572#issuecomment-1144416689

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文