繁体   English   中英

HelloWorld vert.x 未启动

[英]HelloWorld vert.x not starting

我正在尝试基于此运行 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 运行 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 版本”,但它仍然抱怨 shell 文件中的内容,如前所述。

这是 start 命令引用的文件:

#!/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

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

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM