我在全局和本地项目中使用webdriver-manager 12.0.6。
当我在本地运行webdriver-manager update--standalone false
时,我得到未处理的承诺拒绝错误:
$ node_modules/.bin/webdriver-manager update --standalone false
webdriver-manager: using local installed version 12.0.6
(node:13792) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, open 'C:\Users\<MY_USERNAME>\src\<MY_PROJECT>\api\ClientApp\node_modules\webdriver-manager\selenium\chrome-response.xml'
(node:13792) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:13792) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): Error: ENOENT: no such file or directory, open 'C:\Users\<MY_USERNAME>\src\<MY_PROJECT>\api\ClientApp\node_modules\webdriver-manager\selenium\gecko-response.json'
当我在全球范围内运行相同的命令时,一切都可以正常运行。
$ webdriver-manager clean
[12:49:15] I/file_manager - removed chromedriver_2.37.exe
[12:49:15] I/file_manager - removed chromedriver_2.37.zip
[12:49:15] I/file_manager - removed geckodriver-v0.20.0.exe
[12:49:15] I/file_manager - removed geckodriver-v0.20.0.zip
[12:49:15] I/file_manager - removed gecko-response.json
[12:49:15] I/file_manager - removed standalone-response.xml
$ webdriver-manager update --standalone false
[12:49:24] I/update - chromedriver: unzipping chromedriver_2.37.zip
[12:49:25] I/update - geckodriver: unzipping geckodriver-v0.20.0.zip
我尝试删除node_modules并重新运行纱线。不知道还有什么在这里发挥作用。我可以采取哪些步骤来进一步解决此问题?
答案 0 :(得分:1)
删除文件夹:
C:\Users\<MY_USERNAME>\src\<MY_PROJECT>\api\ClientApp\node_modules\webdriver-manager\selenium
在新打开的cmd窗口中再次运行webdriver-manager update --standalone false