小编Asa*_*aak的帖子

找不到模块“axios”

我正在使用 node.js 为 Firebase 函数编写一个小程序。我总是使用 npm 安装我的节点模块,我也只使用 npm 安装了 axios。

但是,当我这样做时,firebase deploy我收到此错误:

在此处输入图片说明

这是我的 package-lock.json

{
  "requires": true,
  "lockfileVersion": 1,
  "dependencies": {
    "axios": {
      "version": "0.19.0",
      "resolved": "https://registry.npmjs.org/axios/-/axios-0.19.0.tgz",
      "integrity": "sha512-1uvKqKQta3KBxIz14F2v06AEHZ/dIoeKfbTRkK1E5oqjDnuEerLmYTgJB5AiQZHJcljpg1TuRzdjDR06qNk0DQ==",
      "requires": {
        "follow-redirects": "1.5.10",
        "is-buffer": "^2.0.2"
      }
    },
    "debug": {
      "version": "3.1.0",
      "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz",
      "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==",
      "requires": {
        "ms": "2.0.0"
      }
    },
    "follow-redirects": {
      "version": "1.5.10",
      "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.5.10.tgz",
      "integrity": "sha512-0V5l4Cizzvqt5D44aTXbFZz+FtyXV1vrDN6qrelxtfYQKW0KO0W2T/hkE8xvGa/540LkZlkaUjO4ailYTFtHVQ==",
      "requires": {
        "debug": "=3.1.0"
      }
    },
    "is-buffer": {
      "version": "2.0.4",
      "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-2.0.4.tgz",
      "integrity": "sha512-Kq1rokWXOPXWuaMAqZiJW4XxsmD9zGx9q4aePabbn3qCRGedtH7Cm+zV8WETitMfu1wdh+Rvd6w5egwSngUX2A=="
    },
    "ms": {
      "version": "2.0.0", …
Run Code Online (Sandbox Code Playgroud)

node.js firebase google-cloud-functions axios

11
推荐指数
1
解决办法
2万
查看次数

使用 Javafx 和 Maven 的 ImageView 的 URL 路径

我正在设计一个 JavaFX 程序,使用 zenjava 基本原型。一切都可以正常查找,除非我想使用 ImageView 小部件添加图像。

我在 src/main/resources 下创建了一个名为 images 的新文件夹,其中存储要在 ImageView 上显示的图像。

所以,根据这个图像存储在/src/main/resources/images/image.jpg

问题是,我打开 SceneBuilder 并从文件夹 C:\Users\Toni\workspace\MyProject\src\main\resources\images\image.jpg 中拖放图像,我可以在屏幕上看到图像。我保存 fxml 文件,然后打开它,fxml 文件引用图像,如下所示:

<ImageView fitHeight="200.0" fitWidth="200.0" layoutX="1463.0" layoutY="551.0">
     <image>
        <Image url="@../images/image.jpg" />
     </image>
  </ImageView>
Run Code Online (Sandbox Code Playgroud)

但是,当我编译并运行它时,出现以下错误:

[INFO] --- javafx-maven-plugin:8.1.2:run (default-cli) @ QAdmin ---
[INFO] Running JavaFX Application
null/../images/wait_time_icon.png
Exception in Application start method
[WARNING] 
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.codehaus.mojo.exec.ExecJavaMojo$1.run(ExecJavaMojo.java:297)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(LauncherImpl.java:917)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$156(LauncherImpl.java:182)
... …
Run Code Online (Sandbox Code Playgroud)

fxml javafx-8

7
推荐指数
1
解决办法
9454
查看次数