René's URL Explorer Experiment


Title: test_runner: directory arguments to --test fail with MODULE_NOT_FOUND on Windows (regression since v20) · Issue #64555 · nodejs/node · GitHub

Open Graph Title: test_runner: directory arguments to --test fail with MODULE_NOT_FOUND on Windows (regression since v20) · Issue #64555 · nodejs/node

X Title: test_runner: directory arguments to --test fail with MODULE_NOT_FOUND on Windows (regression since v20) · Issue #64555 · nodejs/node

Description: Version test_runner: directory arguments to --test crash with MODULE_NOT_FOUND instead of being searched (since v21) Platform Microsoft Windows NT 10.0.26200.0 x64 Subsystem test_runner What steps will reproduce the bug? Create a directo...

Open Graph Description: Version test_runner: directory arguments to --test crash with MODULE_NOT_FOUND instead of being searched (since v21) Platform Microsoft Windows NT 10.0.26200.0 x64 Subsystem test_runner What steps ...

X Description: Version test_runner: directory arguments to --test crash with MODULE_NOT_FOUND instead of being searched (since v21) Platform Microsoft Windows NT 10.0.26200.0 x64 Subsystem test_runner What steps ...

Opengraph URL: https://github.com/nodejs/node/issues/64555

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"test_runner: directory arguments to --test fail with MODULE_NOT_FOUND on Windows (regression since v20)","articleBody":"### Version\n\ntest_runner: directory arguments to --test crash with MODULE_NOT_FOUND instead of being searched (since v21)\n\n\n### Platform\n\n```text\nMicrosoft Windows NT 10.0.26200.0 x64\n```\n\n### Subsystem\n\ntest_runner\n\n### What steps will reproduce the bug?\n\nCreate a directory containing a single test file:\n\n`tests/sample.test.mjs`:\n\n```js\nimport test from 'node:test';\ntest('ok', () => {});\n```\n\nThen, on Windows, pass the directory to the test runner:\n\n```console\nnode --test tests\nnode --test tests/\nnode --test tests\\\n```\n\nAll three fail with `MODULE_NOT_FOUND` — the directory is executed as if it\nwere a test file instead of being searched for test files.\n\nFor contrast, all of the following work:\n\n- `node --test` with no arguments in the same folder (default discovery finds and runs the test)\n- the same three commands on Node v20.20.2 on Windows\n- passing a directory on Linux/macOS\n\n\n### How often does it reproduce? Is there a required condition?\n\nAlways, on Windows, whenever a directory path is passed as an argument to --test.\n\n\n### What is the expected behavior? Why is that the expected behavior?\n\nPassing a directory to `node --test` should recursively search it for test\nfiles and run them, as documented, as Node v20 does on Windows, and as current\nversions still do on Linux/macOS.\n\n\n### What do you see instead?\n\nThe directory is treated as a single test file and executed directly, which\nfails in the module loader:\n\n```console\nPS C:\\Users\\KIIT\\node-bug-repro> node --test tests/\nnode:internal/modules/cjs/loader:1368\n  throw err;\n  ^\n\nError: Cannot find module 'C:\\Users\\KIIT\\node-bug-repro\\tests'\n    at Function._resolveFilename (node:internal/modules/cjs/loader:1365:15)\n    at defaultResolveImpl (node:internal/modules/cjs/loader:1021:19)\n    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1026:22)\n    at Function._load (node:internal/modules/cjs/loader:1175:37)\n    at TracingChannel.traceSync (node:diagnostics_channel:322:14)\n    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)\n    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:171:5)\n    at node:internal/main/run_main_module:36:49 {\n  code: 'MODULE_NOT_FOUND',\n  requireStack: []\n}\n\nNode.js v22.18.0\n✖ tests (70.2044ms)\n  'test failed'\nℹ tests 1\nℹ suites 0\nℹ pass 0\nℹ fail 1\nℹ cancelled 0\nℹ skipped 0\nℹ todo 0\nℹ duration_ms 79.0802\n\n✖ failing tests:\n\ntest at tests:1:1\n✖ tests (70.2044ms)\n  'test failed'\n```\n\nThe output is identical for `node --test tests` and `node --test tests\\`.\n\n\n### Additional information\n\nThis appears to be a regression between v20.20.2 (works) and v22.x (broken).\nPossibly related to the test runner's file discovery moving to the internal\nglob implementation (`createTestFileList` in `lib/internal/test_runner/runner.js`),\nwhere a directory pattern seems to match the directory itself rather than\nbeing expanded to the test files inside it.\n\nHappy to work on a fix if a collaborator confirms this is a bug.\n","author":{"url":"https://github.com/dhruvvv0913","@type":"Person","name":"dhruvvv0913"},"datePublished":"2026-07-17T10:51:16Z","url":"https://github.com/nodejs/node/issues/64555"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:b690f455-4fad-3a83-75bf-a796c6fb0500
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id9E6E:242B39:580B37:77DC04:6AED216D
html-safe-nonce127fb6cae3b4c8a47775c13851b55def19703d76feba2023bf4fe4836e489388
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5RTZFOjI0MkIzOTo1ODBCMzc6NzdEQzA0OjZBRUQyMTZEIiwidmlzaXRvcl9pZCI6IjI3OTI4MzI0MjYyMzQ5NDU5MDEiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca3521b93f66e240a08a152316e61af8a5950a09c95db7c5b014fe877905d0f57
hovercard-subject-tagissue:4910613738
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/nodejs/node/64555/issue_layout
twitter:imagehttps://opengraph.githubassets.com/7711e17da6213f9fbcef3588a56882e04ce73f4be1b5114b4f4f4e5a2086aa02/nodejs/node/issues/64555
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/7711e17da6213f9fbcef3588a56882e04ce73f4be1b5114b4f4f4e5a2086aa02/nodejs/node/issues/64555
og:image:altVersion test_runner: directory arguments to --test crash with MODULE_NOT_FOUND instead of being searched (since v21) Platform Microsoft Windows NT 10.0.26200.0 x64 Subsystem test_runner What steps ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamedhruvvv0913
hostnamegithub.com
expected-hostnamegithub.com
Nonee3e0f7f63e50c6fe879198a93a0a023a648ecc0a5e9bc3b5e033ac57172237e6
turbo-cache-controlno-preview
go-importgithub.com/nodejs/node git https://github.com/nodejs/node.git
octolytics-dimension-user_id9950313
octolytics-dimension-user_loginnodejs
octolytics-dimension-repository_id27193779
octolytics-dimension-repository_nwonodejs/node
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id27193779
octolytics-dimension-repository_network_root_nwonodejs/node
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release707a24b346ac8a82878b9c084efaa38a997660cb
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/nodejs/node/issues/64555#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F64555
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fnodejs%2Fnode%2Fissues%2F64555
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=nodejs%2Fnode
Reloadhttps://github.com/nodejs/node/issues/64555
Reloadhttps://github.com/nodejs/node/issues/64555
Reloadhttps://github.com/nodejs/node/issues/64555
nodejshttps://github.com/nodejs
nodehttps://github.com/nodejs/node
Codehttps://github.com/nodejs/node
Issues656 (656)https://github.com/nodejs/node/issues
Pull requests666 (666)https://github.com/nodejs/node/pulls
Actionshttps://github.com/nodejs/node/actions
Projectshttps://github.com/nodejs/node/projects
Security and qualityhttps://github.com/nodejs/node/security
Insightshttps://github.com/nodejs/node/pulse
https://github.com/nodejs/node
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64555
New issuehttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64555
#64659https://github.com/nodejs/node/pull/64659
test_runner: directory arguments to --test fail with MODULE_NOT_FOUND on Windows (regression since v20)https://github.com/nodejs/node/issues/64555#top
#64659https://github.com/nodejs/node/pull/64659
test_runnerIssues and PRs related to the test runner subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22test_runner%22
https://github.com/dhruvvv0913
dhruvvv0913https://github.com/dhruvvv0913
on Jul 17, 2026https://github.com/nodejs/node/issues/64555#issue-4910613738
https://github.com/dhruvvv0913
dhruvvv0913https://github.com/dhruvvv0913
on Jul 17, 2026https://github.com/nodejs/node/issues/64555#issuecomment-5005548757
https://github.com/nodejs/node/blob/v20.20.2/lib/internal/test_runner/runner.js#L91-L126https://github.com/nodejs/node/blob/v20.20.2/lib/internal/test_runner/runner.js#L91-L126
https://github.com/nodejs/node/blob/v22.18.0/lib/internal/test_runner/runner.js#L108-L126https://github.com/nodejs/node/blob/v22.18.0/lib/internal/test_runner/runner.js#L108-L126
https://github.com/nodejs/node/blob/v20.20.2/doc/api/test.mdhttps://github.com/nodejs/node/blob/v20.20.2/doc/api/test.md
https://github.com/efekrskl
efekrsklhttps://github.com/efekrskl
on Jul 18, 2026https://github.com/nodejs/node/issues/64555#issuecomment-5010897622
semver majorhttps://github.com/nodejs/node/blob/main/doc/changelogs/CHANGELOG_V21.md
efekrsklhttps://github.com/efekrskl
test_runnerIssues and PRs related to the test runner subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22test_runner%22
on Jul 18, 2026https://github.com/nodejs/node/issues/64555#event-28156576061
https://github.com/dhruvvv0913
dhruvvv0913https://github.com/dhruvvv0913
on Jul 18, 2026https://github.com/nodejs/node/issues/64555#issuecomment-5010946060
https://github.com/efekrskl
efekrsklhttps://github.com/efekrskl
on Jul 18, 2026https://github.com/nodejs/node/issues/64555#issuecomment-5011976423
https://github.com/bitpshr
bitpshrhttps://github.com/bitpshr
on Jul 21, 2026https://github.com/nodejs/node/issues/64555#issuecomment-5029784701
#64637https://github.com/nodejs/node/pull/64637
trivikrhttps://github.com/trivikr
completedhttps://github.com/nodejs/node/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
838a3e9https://github.com/nodejs/node/commit/838a3e90510c2fba5222d35f9e74ec85364e2bb9
on Aug 21, 2026https://github.com/nodejs/node/issues/64555#event-29825542556
pullhttps://github.com/apps/pull
on Aug 21, 2026https://github.com/nodejs/node/issues/64555#event-29825678347
test_runner: restore directory search for --testhttps://github.com/MC-MAGA/node/commit/838a3e90510c2fba5222d35f9e74ec85364e2bb9
838a3e9https://github.com/MC-MAGA/node/commit/838a3e90510c2fba5222d35f9e74ec85364e2bb9
aduh95https://github.com/aduh95
on Aug 25, 2026https://github.com/nodejs/node/issues/64555#event-30010185482
test_runner: restore directory search for --testhttps://github.com/nodejs/node/commit/dfda0f24c56aee569a208264de92125fd070fd63
dfda0f2https://github.com/nodejs/node/commit/dfda0f24c56aee569a208264de92125fd070fd63
test_runner: restore directory search for --testhttps://github.com/nodejs/node/commit/1ad7ca310afc7dad38f49b0d3f9d3b59b8f3d6a2
1ad7ca3https://github.com/nodejs/node/commit/1ad7ca310afc7dad38f49b0d3f9d3b59b8f3d6a2
amsClawhttps://github.com/amsClaw
on Sep 26, 2026https://github.com/nodejs/node/issues/64555#event-31895481300
H1 — socle V3 : tests, jetons de design, squelette de page (#2)https://github.com/amsClaw/debarras-alsace/commit/1e37c831c4bc4055dacb30177f111ee234b1cd48
#2https://github.com/amsClaw/debarras-alsace/pull/2
1e37c83https://github.com/amsClaw/debarras-alsace/commit/1e37c831c4bc4055dacb30177f111ee234b1cd48
xirothedevhttps://github.com/xirothedev
on Sep 30, 2026https://github.com/nodejs/node/issues/64555#event-32184120249
Quote the test glob so the runner finds files on Node 24https://github.com/the-aris-club/aris-web/commit/10104471518b758a523652eaef9b427d30fa2a2e
1010447https://github.com/the-aris-club/aris-web/commit/10104471518b758a523652eaef9b427d30fa2a2e
Give the page one module for what it does in response to the viewport (…https://github.com/the-aris-club/aris-web/commit/929e22f679bf3da2627fca5b2311e7e76e969996
…https://github.com/the-aris-club/aris-web/pull/9
929e22fhttps://github.com/the-aris-club/aris-web/commit/929e22f679bf3da2627fca5b2311e7e76e969996
jaw-shhttps://github.com/jaw-sh
on Oct 5, 2026https://github.com/nodejs/node/issues/64555#event-32554628337
test(board): pass asset tests to node by filehttps://github.com/usips/trufflepig/commit/f68b140cb6dd8c50042b00ffdd2b9910b8170533
f68b140https://github.com/usips/trufflepig/commit/f68b140cb6dd8c50042b00ffdd2b9910b8170533
dishanagalawattahttps://github.com/dishanagalawatta
on Oct 14, 2026https://github.com/nodejs/node/issues/64555#event-33225233348
fix: pass explicit test files to node --test (dir arg broken on Node 22)https://github.com/dishanagalawatta/phone-mcp/commit/c804dd2a32684813641fed61d69a85e675badc44
c804dd2https://github.com/dishanagalawatta/phone-mcp/commit/c804dd2a32684813641fed61d69a85e675badc44
vanja-sanhttps://github.com/vanja-san
on Oct 18, 2026https://github.com/nodejs/node/issues/64555#event-33583141892
Fix CI: pass test files explicitly, not the tests directoryhttps://github.com/vanja-san/JS-UserScripts/commit/1d1fe271a5dd83128faa0a7079cf6cc12dab0aae
1d1fe27https://github.com/vanja-san/JS-UserScripts/commit/1d1fe271a5dd83128faa0a7079cf6cc12dab0aae
qux-bbbhttps://github.com/qux-bbb
on Oct 24, 2026https://github.com/nodejs/node/issues/64555#event-34108138903
fix(test): drop directory argument from node --test scripthttps://github.com/qux-bbb/dsh-plugin-todo/commit/e4f74a17f9159775b28bfba47f1c2d7a48c9ef95
e4f74a1https://github.com/qux-bbb/dsh-plugin-todo/commit/e4f74a17f9159775b28bfba47f1c2d7a48c9ef95
kessleriohttps://github.com/kesslerio
on Nov 5, 2026https://github.com/nodejs/node/issues/64555#event-35284139695
fix: bind HTTP sessions to bearer principal, 404 unknown session idshttps://github.com/kesslerio/yourls-mcp/commit/5fa8d1c14d9ed6106617f1f0d61e0009d5b02fd8
5fa8d1chttps://github.com/kesslerio/yourls-mcp/commit/5fa8d1c14d9ed6106617f1f0d61e0009d5b02fd8
Sign up for freehttps://github.com/signup?return_to=https://github.com/nodejs/node/issues/64555
Sign in to commenthttps://github.com/login?return_to=https://github.com/nodejs/node/issues/64555
test_runnerIssues and PRs related to the test runner subsystem.https://github.com/nodejs/node/issues?q=state%3Aopen%20label%3A%22test_runner%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.