尝试安装 selenium-standalone 但出现此错误,知道吗?
$ ./node_modules/.bin/selenium-standalone install
not found: java
Usage: selenium-standalone action [options]
我安装了 java,但不知道它是否需要位于特定的文件位置。
Bootcamp Student 2@DESKTOP-AI3C36U MINGW64 ~/Desktop/Webdriverframework
$ npm install -save-dev selenium-standalone@6.15.3 npm WARN webdriverframework@1.0.0 No repository field.
+ selenium-standalone@6.15.3
added 18 packages from 18 contributors and audited 493 packages in 6.873s
found 0 vulnerabilities
Bootcamp Student 2@DESKTOP-AI3C36U MINGW64 ~/Desktop/Webdriverframework
$ ./node_modules/.bin/selenium-standalone install not found: java
Usage: selenium-standalone action [options]
它应该安装,然后我应该能够启动它。
最佳答案
您提到安装了 Java,但没有提到 Java 是否在您的 PATH
环境变量中。添加 JAVA_HOME
环境变量,然后将 %JAVA_HOME%\bin
添加到 PATH
环境变量。
关于java - 错误: not found: java Usage: selenium-standalone action [options],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58735283/