ni
ni copied to clipboard
don't working in node 14
Describe the bug
I get an error, because the node 14 doesn't have built-in node:timers/promises
related issues https://github.com/antfu/ni/issues/192
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:timers/promises
at new NodeError (internal/errors.js:322:7)
at Loader.builtinStrategy (internal/modules/esm/translators.js:285:11)
at new ModuleJob (internal/modules/esm/module_job.js:63:26)
at Loader.getModuleJob (internal/modules/esm/loader.js:258:11)
at async ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:78:21)
at async Promise.all (index 11)
at async link (internal/modules/esm/module_job.js:83:9) {
code: 'ERR_UNKNOWN_BUILTIN_MODULE'
}
Reproduction
sudo npm i n -g
sudo n 14
ni
the error
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^
Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:timers/promises
at new NodeError (internal/errors.js:322:7)
at Loader.builtinStrategy (internal/modules/esm/translators.js:285:11)
at new ModuleJob (internal/modules/esm/module_job.js:63:26)
at Loader.getModuleJob (internal/modules/esm/loader.js:258:11)
at async ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:78:21)
at async Promise.all (index 11)
at async link (internal/modules/esm/module_job.js:83:9) {
code: 'ERR_UNKNOWN_BUILTIN_MODULE'
}
It seems to be an extra problem, it works if I change execa to 7.1.1.
- "execa": "^8.0.1",
+ "execa": "^7.1.1",
Reproduction
above
System Info
System:
OS: macOS 14.2
CPU: (8) x64 Apple M1 Pro
Memory: 43.56 MB / 16.00 GB
Shell: 3.2.57 - /bin/sh
Binaries:
Node: 14.20.0 - /usr/local/bin/node
npm: 6.14.17 - /usr/local/bin/npm
bun: 1.0.14 - /opt/homebrew/bin/bun
Browsers:
Chrome: 120.0.6099.109
Safari: 17.2
Used Package Manager
npm
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- [X] Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
- [X] The provided reproduction is a minimal reproducible of the bug.
In some new version of ni has dropped node v14 support, you can use some old versions like 0.21.3, which is fine with v14
I don't mind downgrading execa, but for future-proof I'd also suggest you to upgrade your node.
PR Welcome :)