简体   繁体   English

找不到模块vertx /容器

[英]Cannot find module vertx/container

I installed the latest version of Vert.x , 3.0.0 , and pointed the path in system variables to /bin directory. 我安装了Vert.x的最新版本3.0.0 ,并将系统变量中的路径指向/ bin目录。 I have the latest version of java installed on my machine. 我在计算机上安装了最新版本的Java。 I am getting the following error when trying to run the below code: 尝试运行以下代码时出现以下错误:

C:\Users\test\>vertx run app.js Failed in deploying verticle
javax.script.ScriptException: Error: Cannot find module vertx/container in <eval > at line number 141 at column number 6
at jdk.nashorn.api.scripting.NashornScriptEngine.throwAsScriptException( NashornScriptEngine.java:467)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE ngine.java:451)
at jdk.nashorn.api.scripting.NashornScriptEngine.evalImpl(NashornScriptE ngine.java:403)

My verticle: 我的文字:

var container = require("vertx/container");
container.deployModule("io.vertx~mod-web-server~3.0.0-final", {
  port: 8080,
  host: "localhost"
});

For those who also facing this issue on this: The equivalent JavaScript for Vert.x 3 is here on github 对于那些也面临以下问题的人: github上的Vert.x 3等效JavaScript

No need to require('vertx') anymore, and response is a method now. 不再需要require('vertx')了,现在响应是一种方法。

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

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