antfu-collective / ni

💡 Use the right package manager
MIT License
6.25k stars 208 forks source link

Error on node16 when using the latest version 0.21.9 #185

Closed waleiwalei closed 9 months ago

waleiwalei commented 10 months ago

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

kricsleo commented 9 months ago

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

waleiwalei commented 9 months ago

@kricsleo the version of ni is 0.21.9

kricsleo commented 9 months ago

@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
antfu commented 9 months ago

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

waleiwalei commented 9 months ago

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' }`