NW-Builder-NWJS Win64使用NW-Builder构建的应用程序不运行我的代码,仅显示默认的NWJS Splash屏幕
我正在尝试为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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
对于NWBuild的部分:
添加以下风味可以解决问题:
for nwbuild part:
add in the flavour below may solve the issue:
这可能与您遇到的问题有关,因为您都在使用葡萄酒: 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