Title: fs.cpSync with dereference: true does not dereference (regression in 22.17) · Issue #59168 · nodejs/node · GitHub
Open Graph Title: fs.cpSync with dereference: true does not dereference (regression in 22.17) · Issue #59168 · nodejs/node
X Title: fs.cpSync with dereference: true does not dereference (regression in 22.17) · Issue #59168 · nodejs/node
Description: Version 22.17.1 and 22.17.0 Platform Darwin 24.5.0 Subsystem fs What steps will reproduce the bug? workspace nvm use 22.16 Using Node v22.16.0 workspace rm -rf node-repro; mkdir node-repro && cd node-repro && mkdir src linked && touch li...
Open Graph Description: Version 22.17.1 and 22.17.0 Platform Darwin 24.5.0 Subsystem fs What steps will reproduce the bug? workspace nvm use 22.16 Using Node v22.16.0 workspace rm -rf node-repro; mkdir node-repro && cd no...
X Description: Version 22.17.1 and 22.17.0 Platform Darwin 24.5.0 Subsystem fs What steps will reproduce the bug? workspace nvm use 22.16 Using Node v22.16.0 workspace rm -rf node-repro; mkdir node-repro &&am...
Opengraph URL: https://github.com/nodejs/node/issues/59168
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"fs.cpSync with dereference: true does not dereference (regression in 22.17)","articleBody":"### Version\n\n22.17.1 and 22.17.0\n\n### Platform\n\n```text\nDarwin 24.5.0\n```\n\n### Subsystem\n\nfs\n\n### What steps will reproduce the bug?\n\n```\nworkspace nvm use 22.16\nUsing Node v22.16.0\n workspace rm -rf node-repro; mkdir node-repro && cd node-repro && mkdir src linked && touch linked/foo && ln -s ../linked/foo src/bar && node -e \"fs.cpSync('./src', './out', {dereference: true, recursive: true})\" && ls -la out && cd ..\ntotal 0\ndrwxr-xr-x 3 robhogan staff 96 22 Jul 15:14 .\ndrwxr-xr-x 5 robhogan staff 160 22 Jul 15:14 ..\n-rw-r--r-- 1 robhogan staff 0 22 Jul 15:14 bar\n workspace nvm use 22.17.0\nUsing Node v22.17.0\n workspace rm -rf node-repro; mkdir node-repro && cd node-repro && mkdir src linked && touch linked/foo && ln -s ../linked/foo src/bar && node -e \"fs.cpSync('./src', './out', {dereference: true, recursive: true})\" && ls -la out && cd ..\ntotal 0\ndrwxr-xr-x 3 robhogan staff 96 22 Jul 15:14 .\ndrwxr-xr-x 5 robhogan staff 160 22 Jul 15:14 ..\nlrwxr-xr-x 1 robhogan staff 47 22 Jul 15:14 bar -> /Users/robhogan/workspace/node-repro/linked/foo\n```\n\n### How often does it reproduce? Is there a required condition?\n\nAppears to reproduce consistently, no known conditions\n\n### What is the expected behavior? Why is that the expected behavior?\n\nIn all versions up to 22.17, when `{dereference: true}` was passed as an option to `fs.cpSync`, any symlinks in the source directory would be dereferenced and their targets copied to the destination.\n\n\n\n### What do you see instead?\n\nIn 22.17, a symlink is created in destination instead of a copy of the symlink's target, which is the same as `{dereference: false}`.\n\n### Additional information\n\nAppears closely related to https://github.com/nodejs/node/issues/58939 and probably has the same blame commit.","author":{"url":"https://github.com/robhogan","@type":"Person","name":"robhogan"},"datePublished":"2025-07-22T14:25:14Z","url":"https://github.com/nodejs/node/issues/59168"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| 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:480b8f1e-c951-27d1-0d65-622c1e1d6046 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A186:39BC20:11131A8:16D3989:6AED596C |
| html-safe-nonce | f63990808d23b20a136de6f73a968b2b17d064cf7589d8873a135137c571ea3e |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMTg2OjM5QkMyMDoxMTEzMUE4OjE2RDM5ODk6NkFFRDU5NkMiLCJ2aXNpdG9yX2lkIjoiMTU0MTQ5MDU2MDYyOTI5OTU2NCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 5370793e22a25bba1795989b4cbf9c6651bab2024ad7cea4818a601176357a3e |
| hovercard-subject-tag | issue:3252912861 |
| 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/59168/issue_layout |
| twitter:image | https://opengraph.githubassets.com/c1a72b8fb7489e82292fdc4bce57f9361d15fa1c3ec70c163c5309275521d58d/nodejs/node/issues/59168 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/c1a72b8fb7489e82292fdc4bce57f9361d15fa1c3ec70c163c5309275521d58d/nodejs/node/issues/59168 |
| og:image:alt | Version 22.17.1 and 22.17.0 Platform Darwin 24.5.0 Subsystem fs What steps will reproduce the bug? workspace nvm use 22.16 Using Node v22.16.0 workspace rm -rf node-repro; mkdir node-repro && cd no... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | robhogan |
| hostname | github.com |
| expected-hostname | github.com |
| None | 56fb42677ae87ed3e64410323d67980aa65d0485568a7858f874e7edfc6d1c11 |
| 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 | 9c9a37e2423ed382cf39f70b5aa4b4858b40a3b0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width