gpt4 book ai didi

javascript - HelloWorld vert.x 未启动

转载 作者:行者123 更新时间:2023-12-02 22:43:25 24 4
gpt4 key购买 nike

我正在尝试基于此运行 vert.x HelloWorld 项目:https://vertx.io/blog/vert-x3-says-hello-to-npm-users/

我已经完成了 npm init 并安装了 vertx3-min 3.8.3。但是当我执行“npm start”时,出现以下错误:

vertxdemo@1.0.0 启动 C:\Users\Tiago Redaelli\Desktop\VertxDemo

vertx run server.js

C:\Users\Tiago Redaelli\Desktop\VertxDemo>#!/bin/sh       
'#!' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Tiago Redaelli\Desktop\VertxDemo>basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
'basedir' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Tiago Redaelli\Desktop\VertxDemo>case `uname` in
'case' is not recognized as an internal or external command,
operable program or batch file.

C:\Users\Tiago Redaelli\Desktop\VertxDemo>*CYGWIN* | *MINGW* | *MSYS*) basedir=`cygpath -w "$basedir"`;;
'*CYGWIN*' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! vertxdemo@1.0.0 start: `vertx run server.js`
npm ERR! Exit status 255
npm ERR!
npm ERR! Failed at the vertxdemo@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Tiago Redaelli\AppData\Roaming\npm-cache\_logs\2019-10-23T09_18_52_079Z-debug.log
PS C:\Users\Tiago Redaelli\Desktop\VertxDemo>

从示例中尝试启动 server.js 的部分如下所示:

"start": "./node_modules/.bin/vertx run server.js"

这是项目目录

更新

安装 vertx 3.8 并将路径设置为 C:\Program Files\vertx\bin 后,我可以输入“vertx version”,但它仍然提示 shell 文件中的内容,如前面所示。

这是启动命令引用的文件:

#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")

case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac

if [ -x "$basedir//bin/bash" ]; then
"$basedir//bin/bash" "$basedir/../vertx3-min/vertx/bin/vertx" "$@"
ret=$?
else
/bin/bash "$basedir/../vertx3-min/vertx/bin/vertx" "$@"
ret=$?
fi
exit $ret

最佳答案

您使用的是 Windows 操作系统,因此您的启动脚本应该是 bat 脚本:

vertx.bat

尝试用该命令替换以前的命令,您的应用程序应该可以运行。

关于javascript - HelloWorld vert.x 未启动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58510983/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com