Title: process.cwd() fails in a not usefully descriptive way · Issue #57045 · nodejs/node · GitHub
Open Graph Title: process.cwd() fails in a not usefully descriptive way · Issue #57045 · nodejs/node
X Title: process.cwd() fails in a not usefully descriptive way · Issue #57045 · nodejs/node
Description: Version 22.14.0 Platform macOS Sequoia 15.1.1 Subsystem process What steps will reproduce the bug? ~/Code/platformatic via v22.14.0 on ☁️ (us-east-1) ❯ mkdir lol ~/Code/platformatic via v22.14.0 on ☁️ (us-east-1) ❯ cd lol Code/platfo...
Open Graph Description: Version 22.14.0 Platform macOS Sequoia 15.1.1 Subsystem process What steps will reproduce the bug? ~/Code/platformatic via v22.14.0 on ☁️ (us-east-1) ❯ mkdir lol ~/Code/platformatic via v22.14....
X Description: Version 22.14.0 Platform macOS Sequoia 15.1.1 Subsystem process What steps will reproduce the bug? ~/Code/platformatic via v22.14.0 on ☁️ (us-east-1) ❯ mkdir lol ~/Code/platformatic via v22.14....
Opengraph URL: https://github.com/nodejs/node/issues/57045
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"process.cwd() fails in a not usefully descriptive way","articleBody":"### Version\n\n22.14.0\n\n### Platform\n\n```text\nmacOS Sequoia 15.1.1\n```\n\n### Subsystem\n\nprocess\n\n### What steps will reproduce the bug?\n\n```sh\n~/Code/platformatic via v22.14.0 on ☁️ (us-east-1)\n❯ mkdir lol\n\n~/Code/platformatic via v22.14.0 on ☁️ (us-east-1)\n❯ cd lol\n\nCode/platformatic/lol on ☁️ (us-east-1)\n❯ rm -rf ../lol\n\nCode/platformatic/lol on ☁️ (us-east-1)\n❯ node -p \"process.cwd()\"\nnode:internal/bootstrap/switches/does_own_process_state:142\n cachedCwd = rawMethods.cwd();\n ^\n\nError: ENOENT: no such file or directory, uv_cwd\n at process.wrappedCwd [as cwd] (node:internal/bootstrap/switches/does_own_process_state:142:28)\n at [eval]:1:9\n at runScriptInThisContext (node:internal/vm:209:10)\n at node:internal/process/execution:449:12\n at [eval]-wrapper:6:24\n at runScriptInContext (node:internal/process/execution:447:60)\n at evalFunction (node:internal/process/execution:87:30)\n at evalScript (node:internal/process/execution:99:3)\n at node:internal/main/eval_string:74:3 {\n errno: -2,\n code: 'ENOENT',\n syscall: 'uv_cwd'\n}\n\nNode.js v22.14.0\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAlways\n\n### What is the expected behavior? Why is that the expected behavior?\n\nCould be made clearer that this is a failure of `process.cwd()` as the stack trace makes no mention of it. One _may_ make the connection by context, but not necessarily--it's non-obvious. If this was triggered by a `process.cwd()` deep in your code somewhere it could be quite confusing.\n\nIt'd also probably be useful to explain the possible scenario in which this could be triggered--the directory the process was working in was deleted somehow.\n\n### What do you see instead?\n\n```\nError: ENOENT: no such file or directory, uv_cwd\n at process.wrappedCwd [as cwd] (node:internal/bootstrap/switches/does_own_process_state:142:28)\n at [eval]:1:9\n at runScriptInThisContext (node:internal/vm:209:10)\n at node:internal/process/execution:449:12\n at [eval]-wrapper:6:24\n at runScriptInContext (node:internal/process/execution:447:60)\n at evalFunction (node:internal/process/execution:87:30)\n at evalScript (node:internal/process/execution:99:3)\n at node:internal/main/eval_string:74:3\n```\n\n### Additional information\n\n_No response_","author":{"url":"https://github.com/Qard","@type":"Person","name":"Qard"},"datePublished":"2025-02-14T15:28:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":7},"url":"https://github.com/57045/node/issues/57045"}
| 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:b0e41213-a217-3c0d-5829-adb76f0e8752 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 9BF2:2D9C9B:DCA8C:130680:6A4C1F63 |
| html-safe-nonce | f1349fd174a1e313f1c31bd0603ba39f76f9fb35ddf3bdc3e8e55138553c51f9 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QkYyOjJEOUM5QjpEQ0E4QzoxMzA2ODA6NkE0QzFGNjMiLCJ2aXNpdG9yX2lkIjoiNjI3NTUxOTg4NTI3OTMxMjM1IiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | d0f073f7c80c8b2574ba950702ba0fbc93caea79486e1d973f9a529832b6bd2a |
| hovercard-subject-tag | issue:2854007962 |
| 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/nodejs/node/57045/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9749f434d3d83fcba2bef7b6dadc3f8195af6de350b4224236400a4b118bf08c/nodejs/node/issues/57045 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9749f434d3d83fcba2bef7b6dadc3f8195af6de350b4224236400a4b118bf08c/nodejs/node/issues/57045 |
| og:image:alt | Version 22.14.0 Platform macOS Sequoia 15.1.1 Subsystem process What steps will reproduce the bug? ~/Code/platformatic via v22.14.0 on ☁️ (us-east-1) ❯ mkdir lol ~/Code/platformatic via v22.14.... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Qard |
| hostname | github.com |
| expected-hostname | github.com |
| None | 1b6b16d04026f131a36d57e3b01d0f4d26a51800edf48bf5ed0256e0ac905511 |
| turbo-cache-control | no-preview |
| go-import | github.com/nodejs/node git https://github.com/nodejs/node.git |
| octolytics-dimension-user_id | 9950313 |
| octolytics-dimension-user_login | nodejs |
| octolytics-dimension-repository_id | 27193779 |
| octolytics-dimension-repository_nwo | nodejs/node |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 27193779 |
| octolytics-dimension-repository_network_root_nwo | nodejs/node |
| 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 | f95fb36c72adc940ff991c03531114b2245658d0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width