vscode-phpunit: UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN

setting.json

{
    "phpunit.phpunit": "${workspaceFolder}/phpunit.phar",
    "phpunit.args": [
        "--configuration ${workspaceFolder}/phpunit.xml"
    ],
}

版本資訊

PHP: 7.2.9 PHPUnit 版本: 8.1.5 PHPUnit 位置: workspace 根目錄 (phpunit.phar) phpunit.xml 位置: workspace 根目錄

image

完整訊息

(node:12924) UnhandledPromiseRejectionWarning: Error: spawn UNKNOWN
    at ChildProcess.spawn (internal/child_process.js:357:11)
    at Object.spawn (child_process.js:540:9)
    at Promise (c:\Users\terry\.vscode\extensions\recca0120.vscode-phpunit-2.0.50\server\out\server.js:6:123901)
    at new Promise (<anonymous>)
    at e.Process.run (c:\Users\terry\.vscode\extensions\recca0120.vscode-phpunit-2.0.50\server\out\server.js:6:123813)
    at e.TestRunner.<anonymous> (c:\Users\terry\.vscode\extensions\recca0120.vscode-phpunit-2.0.50\server\out\server.js:6:122800)
    at Generator.next (<anonymous>)
    at o (c:\Users\terry\.vscode\extensions\recca0120.vscode-phpunit-2.0.50\server\out\server.js:6:121482)
(node:12924) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 30)

命令列執行正常,透過插件不行。

謝謝開發如此美觀好用的插件,可惜目前遇到此問題 尚未使用。如果能解決,那真的很感謝。

About this issue

  • Original URL
  • State: closed
  • Created 5 years ago
  • Comments: 25 (12 by maintainers)

Most upvoted comments

I don’t understand the previous conversation but it might be related to my issue where I’m trying to have this in my settings:

"phpunit.phpunit": "plugins/versionpress/vendor/bin/phpunit"

// or this:
"phpunit.phpunit": "${workspaceFolder}/plugins/versionpress/vendor/bin/phpunit"

but it’s probably not supported – the extension always seems to try an absolute path, I’m getting errors like this:

Error: spawn /${workspaceFolder}/plugins/versionpress/vendor/bin/phpunit ENOENT

or

Error: spawn /plugins/versionpress/vendor/bin/phpunit ENOENT

更新了新版。情況和之前的一樣。 辛苦囉。這麼晚了還沒睡。