【问题标题】:Unable to run nw.js application in ubuntu无法在 ubuntu 中运行 nw.js 应用程序
【发布时间】:2023-03-19 10:26:01
【问题描述】:

我自己根据this link 中给出的教程创建了一个node webkit helloworld 应用程序。我还尝试使用this link 中给出的命令在 ubuntu OS 中运行相同的命令。但是当我运行命令nw /home/myUsername/Documents/myNodeWebkitApps/helloWorld/myApp.nw 时,它会在终端中抛出以下结果。

usage
  nw [udp] <options> <host> <port>

Default TCP protocol can be changed to UDP by ``udp'' argument.
UDP options
  currently none
TCP options
  -f               firewall mode, connection is initiated by netread.
                   Host specification is ignored and can be omited.
  -c               ignored. Transmission checksum is activated by
                   default.
  -C algorithm     use the specified algorithm for checksum. This
                   option also implies -c.
                   Supported algorithms (the first is default):
                       md5 none
general options
  -i <file>        read data from file instead of stdin.
  -b               print speed in b/s instead of B/s
  -h <n>           print `#' after each n KiB transferred (def. 10485.76).
  -H <n>           print `#' after each n MiB transferred (def. 10.24).
  -q               be quiet.
  -v               be verbose.
  -vv              be very verbose.
  -V               show version.
  -vV              show verbose version.
return values
  0                no errors.
  1                some error occured.
  2                checksum validation failed.

我怎样才能像第一个链接一样运行?

【问题讨论】:

    标签: node.js ubuntu node-webkit nw.js


    【解决方案1】:

    最后,我在this link 和这个stackoverflow answer 的帮助下成功运行了hello world 应用程序

    1. 通过命令npm install nw-builder -g安装nw builder
    2. 如果您遇到类似/usr/bin/env: node: No such file or directory 的错误,那么如上面第二个链接中给出的那样,将节点的符号链接设为ln -s /usr/bin/nodejs /usr/bin/node
    3. 现在我们可以通过命令nwbuild -r ~/Desktop/webkit-example 运行我们的应用程序了

    【讨论】:

    • 除了上述步骤之外,当我尝试使用nwbuild -p linux -o ~/Desktop/output ~/Desktop/webkit-example 打包我的应用程序时。所以我在这里提出另一个新问题:stackoverflow.com/questions/34892201/…
    【解决方案2】:

    这里的输出不是来自nw.js,而是来自您机器上安装的netrw。您可以通过从您的机器中删除netrw 或更正nw.js 的路径来修复它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-25
      • 2021-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-06-05
      • 1970-01-01
      相关资源
      最近更新 更多