由于找不到文件 [WSL],npm install geckodriver 失败

npm install geckodriver fails because of file not found [WSL]

在构建依赖于 selenium-cucumber-js 的项目的上下文中,我尝试在以下设置中安装 geckodriver:

当我执行 npm install geckodriver 时,我收到以下错误消息:

npm ERR! path /home/username/myfolder/node_modules/geckodriver/bin/geckodriver
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall chmod
npm ERR! enoent ENOENT: no such file or directory, chmod '/home/username/myfolder/node_modules/geckodriver/bin/geckodriver'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/username/.npm/_logs/2019-02-16T07_38_34_159Z-debug.log

我在日志中找不到更多信息。 我可以使用 webdriver-manager 成功安装 geckodriver,但它不满足 package.json.

中的 selenium-cucumber-js 依赖项

知道如何解决这个问题吗?

编辑:似乎是一个版本范围的问题。 github 跟踪器上的其他人也报告了同样的问题。 https://github.com/vladikoff/node-geckodriver/issues/59

npm install geckodriver@1.14 工作正常。