nw-builder - 使用说明

nw-builder - usage instructions

我正在使用 Node Webkit 创建桌面应用程序。我现在需要创建一个可执行文件,所以安装了以下文件:https://github.com/nwjs/nw-builder

我很难理解说明,尤其是命令行内容。文档说明如下:

Usage: nwbuild [options] [path]

Options: -p, --platforms Platforms to build, comma-sperated, can be: win32,win64,osx32,osx64,linux32,linux64 ['osx32', 'osx64', 'win32', 'win64'] -v, --version The nw version, eg. 0.8.4
[default: "latest"] -r, --run Runs NW.js for the current platform [default: false] -o, --buildDir The build folder [default: "./build"] -f, --forceDownload Force download of NW.js
[default: false] --cacheDir The cache folder --quiet
Disables logging
[default: false]

我有两个文件夹,一个包含应用程序文件和 package.json,另一个文件夹包含所有 NW 文件。我还创建了第三个文件夹,合并了这两个文件夹,并将应用程序的 .zip 文件更改为 .nw 文件。

我从哪里 运行 buildDir 命令?

确切的命令是什么?我尝试了以下命令:

nwbuild -o build

nwbuild --buildDir /build

nwbuild -o, --buildDir /build

但全部返回显示上述使用信息并且 none 个文件夹包含一个 /build/ 文件夹

有人可以帮忙吗?非常感谢

不需要设置buildDir,直接传入路径即可:

nwbuild -p win64 <PATH TO APP FILES>

选项都是可选的,不需要的可以不用设置。如果您愿意,可以更改我在示例中设置的构建平台。