antfu-collective / ni

💡 Use the right package manager

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error on node16 when using the latest version 0.21.9

waleiwalei opened this issue · comments

Describe the bug

`
npm install @antfu/ni -g
ni typescript

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'

}

script returned exit code 1
`

this error started before 6 days ago.

Reproduction

node@16

System Info

mac

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Tried with @antfu/ni@0.21.10(currently latest) in nodejs@16.20.2, it works fine. Any more information or an online reproduction?

@kricsleo the version of ni is 0.21.9

@kricsleo the version of ni is 0.21.9

Sorry, I also tried with 0.21.9, but it didn't show up. Could you please provide an online reproduction? That would help to resolve your issue.

# Here is my env
ni -v
# @antfu/ni  v0.21.9
# node       v16.20.2
# npm        v8.19.4
# npm -g     v8.19.4

We temporarily closed this due to the lack of enough information. We could not identify whether it was a bug or a userland misconfiguration with the given info.
Please provide a minimal reproduction to reopen the issue.
Thanks.

Why reproduction is required

the node version is 14.17.6
`

ni typescript
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^

Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:timers/promises
at Loader.builtinStrategy (internal/modules/esm/translators.js:285:11)
at new ModuleJob (internal/modules/esm/module_job.js:60:26)
at Loader.getModuleJob (internal/modules/esm/loader.js:258:11)
at async ModuleWrap. (internal/modules/esm/module_job.js:75:21)
at async Promise.all (index 11)
at async link (internal/modules/esm/module_job.js:80:9) {
code: 'ERR_UNKNOWN_BUILTIN_MODULE'
}`

`

ni -v
internal/process/esm_loader.js:74
internalBinding('errors').triggerUncaughtException(
^

Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: node:timers/promises
at Loader.builtinStrategy (internal/modules/esm/translators.js:285:11)
at new ModuleJob (internal/modules/esm/module_job.js:60:26)
at Loader.getModuleJob (internal/modules/esm/loader.js:258:11)
at async ModuleWrap. (internal/modules/esm/module_job.js:75:21)
at async Promise.all (index 11)
at async link (internal/modules/esm/module_job.js:80:9) {
code: 'ERR_UNKNOWN_BUILTIN_MODULE'
}`