Title: Fails to run on consecutive runs, Windows 11 24H2: "spawn wmic.exe ENOENT" / "Error: EBUSY: resource busy or locked ... BrowserStackLocal.exe" · Issue #166 · browserstack/browserstack-local-nodejs · GitHub
Open Graph Title: Fails to run on consecutive runs, Windows 11 24H2: "spawn wmic.exe ENOENT" / "Error: EBUSY: resource busy or locked ... BrowserStackLocal.exe" · Issue #166 · browserstack/browserstack-local-nodejs
X Title: Fails to run on consecutive runs, Windows 11 24H2: "spawn wmic.exe ENOENT" / "Error: EBUSY: resource busy or locked ... BrowserStackLocal.exe" · Issue #166 · browserstack/browserstack-local-nodejs
Description: The library ps-tree is used by browserstack-local-nodejs to start and exit the BrowserstackLocal process. However, new Windows 11 24H2 installations are missing wmic.exe, which ps-tree uses, and therefore the BrowserstackLocal keeps runn...
Open Graph Description: The library ps-tree is used by browserstack-local-nodejs to start and exit the BrowserstackLocal process. However, new Windows 11 24H2 installations are missing wmic.exe, which ps-tree uses, and th...
X Description: The library ps-tree is used by browserstack-local-nodejs to start and exit the BrowserstackLocal process. However, new Windows 11 24H2 installations are missing wmic.exe, which ps-tree uses, and th...
Opengraph URL: https://github.com/browserstack/browserstack-local-nodejs/issues/166
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Fails to run on consecutive runs, Windows 11 24H2: \"spawn wmic.exe ENOENT\" / \"Error: EBUSY: resource busy or locked ... BrowserStackLocal.exe\"","articleBody":"The library ps-tree is used by browserstack-local-nodejs to start and exit the BrowserstackLocal process. However, new Windows 11 24H2 installations are missing `wmic.exe`, which ps-tree uses, and therefore the BrowserstackLocal keeps running after the script finishes running. On the next run, browserstack-local-nodejs attempts to download/start a new BrowserstackLocal process and fails.\n\nThe first run of the npm command always ends with these lines, after the Selenium/Browserstack tests run successfully:\n\n```\n\u003e npm run sample-local-test\n...\n2025-10-09 12:16:55 - error: spawn wmic.exe ENOENT\n2025-10-09 12:16:55 - error: Cannot read properties of undefined (reading 'map')\n```\n\nWhen I start the same command again, the script will not run with these errors:\n\n```\n2025-10-09 12:17:37 - info: Project and debug logs are captured by default. To disable, set disableAutoCaptureLogs: true in config.\nDownloading in sync\nnode:events:486\n throw er; // Unhandled 'error' event\n ^\n\nError: EBUSY: resource busy or locked, open 'C:\\Users\\c\\.browserstack\\BrowserStackLocal.exe'\nEmitted 'error' event on WriteStream instance at:\n at emitErrorNT (node:internal/streams/destroy:170:8)\n at emitErrorCloseNT (node:internal/streams/destroy:129:3)\n at process.processTicksAndRejections (node:internal/process/task_queues:90:21) {\n errno: -4082,\n code: 'EBUSY',\n syscall: 'open',\n path: 'C:\\\\Users\\\\c\\\\.browserstack\\\\BrowserStackLocal.exe'\n}\n\nNode.js v24.9.0\n undefined\nRetrying Download. Retries left 9\n2025-10-09 12:17:37 - error: Error: LocalError: Couldn't find binary file\n at BrowserStackSetup.setupBrowserstackLocal (C:\\data\\\\bs\\node_modules\\browserstack-node-sdk\\src\\helpers\\BrowserStackSetup.js:1:17704)\n at process.processTicksAndRejections (node:internal/process/task_queues:105:5)\n at async BrowserStackSetup.initialize (C:\\data\\bs\\node_modules\\browserstack-node-sdk\\src\\helpers\\BrowserStackSetup.js:1:15053)\n at async run (C:\\data\\bs\\node_modules\\browserstack-node-sdk\\src\\bin\\mocha\\command.js:2:21525)\n at async captureError (C:\\data\\bs\\node_modules\\browserstack-node-sdk\\src\\bin\\runner.js:2:4268)\n(node:33796) [DEP0176] DeprecationWarning: fs.R_OK is deprecated, use fs.constants.R_OK instead\n(Use `node --trace-deprecation ...` to show where the warning was created)\n2025-10-09 12:17:37 - error: EPERM: operation not permitted, unlink 'C:\\Users\\c\\.browserstack\\BrowserStackLocal.exe'\n2025-10-09 12:17:37 - error: Size mismatch\n2025-10-09 12:17:37 - error: Size mismatch\n2025-10-09 12:17:37 - error: already finalized or destroyed\n```\n\nI have to exit BrowserStackLocal.exe in Task Manager before I can run my BrowserStack script again.\n\nI don't know if there is any other viable method to exit BrowserStackLocal.exe, or you could just allow it to keep running across sessions?\n\nRelevant issue at ps-tree: https://github.com/indexzero/ps-tree/issues/58\n\n\n","author":{"url":"https://github.com/chk1","@type":"Person","name":"chk1"},"datePublished":"2025-10-09T11:39:08.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/166/browserstack-local-nodejs/issues/166"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:7a556d3b-b476-040c-537a-bf3e285540c2 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9C24:CF8F9:5D2068:7F9BFC:696F23CD |
| html-safe-nonce | d2d9eaaa414a18e5af3fd073bc13b85d1a089ade6bd1ad0f6a96ee3ce55c1d93 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QzI0OkNGOEY5OjVEMjA2ODo3RjlCRkM6Njk2RjIzQ0QiLCJ2aXNpdG9yX2lkIjoiODY3MDI1NDAzODQzNzAxMjQyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | fde3def9dc507ecbeb6a68fb3a65c786aab57f68be390b93ea89ccf09507ed97 |
| hovercard-subject-tag | issue:3498800247 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/browserstack/browserstack-local-nodejs/166/issue_layout |
| twitter:image | https://opengraph.githubassets.com/0da4f64b1a16cfb686a15c0373c5ae596ad1687cdf5fc509a3d02fb7f5aa2b25/browserstack/browserstack-local-nodejs/issues/166 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/0da4f64b1a16cfb686a15c0373c5ae596ad1687cdf5fc509a3d02fb7f5aa2b25/browserstack/browserstack-local-nodejs/issues/166 |
| og:image:alt | The library ps-tree is used by browserstack-local-nodejs to start and exit the BrowserstackLocal process. However, new Windows 11 24H2 installations are missing wmic.exe, which ps-tree uses, and th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | chk1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | b278ad162d35332b6de714dfb005de04386c4d92df6475522bef910f491a35ee |
| turbo-cache-control | no-preview |
| go-import | github.com/browserstack/browserstack-local-nodejs git https://github.com/browserstack/browserstack-local-nodejs.git |
| octolytics-dimension-user_id | 1119453 |
| octolytics-dimension-user_login | browserstack |
| octolytics-dimension-repository_id | 51923223 |
| octolytics-dimension-repository_nwo | browserstack/browserstack-local-nodejs |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 51923223 |
| octolytics-dimension-repository_network_root_nwo | browserstack/browserstack-local-nodejs |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 39aed5006635ab6f45e6b77d23e73b08a00272a3 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width