Title: [v25.7] yargs v17 compatibility issue · Issue #61971 · nodejs/node · GitHub
Open Graph Title: [v25.7] yargs v17 compatibility issue · Issue #61971 · nodejs/node
X Title: [v25.7] yargs v17 compatibility issue · Issue #61971 · nodejs/node
Description: Version v25.7.0 Platform Microsoft Windows NT 10.0.26200.0 x64 Subsystem No response What steps will reproduce the bug? npm i yargs@17.7.2 "require('yargs/yargs')" > 1.cjs node 1.cjs How often does it reproduce? Is there a required condi...
Open Graph Description: Version v25.7.0 Platform Microsoft Windows NT 10.0.26200.0 x64 Subsystem No response What steps will reproduce the bug? npm i yargs@17.7.2 "require('yargs/yargs')" > 1.cjs node 1.cjs How often does...
X Description: Version v25.7.0 Platform Microsoft Windows NT 10.0.26200.0 x64 Subsystem No response What steps will reproduce the bug? npm i yargs@17.7.2 "require('yargs/yargs')" > 1.cjs node...
Opengraph URL: https://github.com/nodejs/node/issues/61971
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[v25.7] yargs v17 compatibility issue","articleBody":"### Version\n\nv25.7.0\n\n### Platform\n\n```text\nMicrosoft Windows NT 10.0.26200.0 x64\n```\n\n### Subsystem\n\n_No response_\n\n### What steps will reproduce the bug?\n\n1. npm i yargs@17.7.2\n2. \"require('yargs/yargs')\" \u003e 1.cjs\n3. node 1.cjs\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\nno errors\n\n### What do you see instead?\n\n```\nfile:///F:/node-yargs/node_modules/yargs/yargs:3\nconst {applyExtends, cjsPlatformShim, Parser, Yargs, processArgv} = require('./build/index.cjs')\n ^\n\nReferenceError: require is not defined in ES module scope, you can use import instead\n at file:///F:/node-yargs/node_modules/yargs/yargs:3:69\n at ModuleJobSync.runSync (node:internal/modules/esm/module_job:534:37)\n at ModuleLoader.importSyncForRequire (node:internal/modules/esm/loader:366:47)\n at loadESMFromCJS (node:internal/modules/cjs/loader:1628:24)\n at Module._compile (node:internal/modules/cjs/loader:1793:5)\n at Object..js (node:internal/modules/cjs/loader:1951:10)\n at Module.load (node:internal/modules/cjs/loader:1532:32)\n at Module._load (node:internal/modules/cjs/loader:1334:12)\n at wrapModuleLoad (node:internal/modules/cjs/loader:255:19)\n at Module.require (node:internal/modules/cjs/loader:1555:12)\n\nNode.js v25.7.\n```\n\n### Additional information\n\nI'm not sure if this is a Node.js issue, because yargs uses a file without an extension as the entry point.\n","author":{"url":"https://github.com/liuxingbaoyu","@type":"Person","name":"liuxingbaoyu"},"datePublished":"2026-02-24T17:33:58.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/61971/node/issues/61971"}
| 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:0657a291-282b-40e1-e101-c3d2d4b8f644 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | EB8E:34CBC3:3EEE0A:55F0BF:6A4C819D |
| html-safe-nonce | e66da670437fd3398fc0cae360763649473b8a6f1237767e1a85b40375294ac5 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQjhFOjM0Q0JDMzozRUVFMEE6NTVGMEJGOjZBNEM4MTlEIiwidmlzaXRvcl9pZCI6IjIxNzQ5MzkwNzI0NzQ5NzYyOSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3a2508bba72755b5add242747f152ba575b7e429389538bcf59ce20a0d982a7e |
| hovercard-subject-tag | issue:3984955976 |
| 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/61971/issue_layout |
| twitter:image | https://opengraph.githubassets.com/412720806fca80b0913e6ced808d8c334062d51aa105d848f5845c48bfd5180b/nodejs/node/issues/61971 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/412720806fca80b0913e6ced808d8c334062d51aa105d848f5845c48bfd5180b/nodejs/node/issues/61971 |
| og:image:alt | Version v25.7.0 Platform Microsoft Windows NT 10.0.26200.0 x64 Subsystem No response What steps will reproduce the bug? npm i yargs@17.7.2 "require('yargs/yargs')" > 1.cjs node 1.cjs How often does... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | liuxingbaoyu |
| hostname | github.com |
| expected-hostname | github.com |
| None | 3d11bb817438277de2a940854450e83a7d32b6aeb5014e9e6b00a6423900251c |
| 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 | cd470457e909b9d062f8002cf438ba870e6acff6 |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width