【问题标题】:Tronbox unbox and tronbox init commands are giving following error:-bash post-unpack.sh && rm post-unpack.sh && npm installTronbox unbox 和 tronbox init 命令给出以下错误:-bash post-unpack.sh && rm post-unpack.sh && npm install
【发布时间】:2019-05-02 06:20:06
【问题描述】:
tronbox unbox metacoin

Downloading...

Unpacking...

Setting up...

Error: Command failed: bash post-unpack.sh && rm post-unpack.sh && npm install

'bash' is not recognized as an internal or external command,
operable program or batch file.

    at ChildProcess.exithandler (child_process.js:289:12)
    at ChildProcess.emit (events.js:182:13)
    at maybeClose (internal/child_process.js:962:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

我在 Windows 10 中尝试过命令 tronbox unbox metacoon。 如何解决上述错误?尝试命令 tronbox init 时出现同样的错误。此 bash 错误的可能原因是什么?

【问题讨论】:

    标签: tronbox


    【解决方案1】:

    'bash' 未被识别为内部或外部命令, 可运行的程序或批处理文件'

    当您尝试直接在窗口的命令提示符中运行 shell 脚本时会出现此错误。

    如果在拆箱 tron 的元币 DApp 时出现此错误,则无需担心。 Metacoin DApp 将在您指定的目录中正确拆箱。

    如果是 IDE Truffle 或 Tronbox,Shell 脚本基本上用于运行一些 javascript 文件。因此,如果您在 Windows 上使用 truffle 或 tronbox,您可以直接运行 javascript 文件,而无需先为其运行 shell 脚本。

    直接从window的命令提示符运行javascript的解决方案:-

    在编辑器中打开 shell 脚本并尝试在其中找到 javascript 文件的名称。现在您可以直接从窗口的命令提示符运行这个 javascipt 文件了。

    您需要在 Window 的命令提示符下使用以下命令(前提条件:- node.js 已安装在您的系统中:-

    节点文件名.js

    我在 IDE、truffle 和 tronbox 上都试过这个。它工作得很好。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-04-03
      • 1970-01-01
      • 2018-02-26
      • 1970-01-01
      • 2020-05-30
      • 2021-10-06
      • 1970-01-01
      相关资源
      最近更新 更多