slidevjs / slidev

Presentation Slides for Developers
https://sli.dev
MIT License
33.26k stars 1.35k forks source link

npm init slidev failed with SyntaxError: The requested module 'node:events' does not provide an export named 'addAbortListener' #1848

Closed owen-kuai closed 1 month ago

owen-kuai commented 2 months ago

Describe the bug

npm init slidev fialed: file:///Users/xuejian.kuai/.npm/_npx/c00c242a51a5200e/node_modules/execa/lib/utils/max-listeners.js:1 import {addAbortListener} from 'node:events'; ^^^^^^^^^^^^^^^^ SyntaxError: The requested module 'node:events' does not provide an export named 'addAbortListener' at ModuleJob._instantiate (node:internal/modules/esm/module_job:123:21) at async ModuleJob.run (node:internal/modules/esm/module_job:189:5) at async Promise.all (index 0) at async ESMLoader.import (node:internal/modules/esm/loader:541:24) at async loadESM (node:internal/process/esm_loader:91:5) at async handleMainPromise (node:internal/modules/run_main:65:12)

Node.js v18.7.0 npm ERR! code 1 npm ERR! path /Users/xuejian.kuai/go-projects/github/slidev npm ERR! command failed npm ERR! command sh /var/folders/jx/jmghpld15v3grlc_wf_q5s9h0000gq/T/npx-709f1cea.sh

npm ERR! A complete log of this run can be found in: npm ERR! /Users/xuejian.kuai/.npm/_logs/2024-09-02T05_52_29_988Z-debug-0.log

Minimal reproduction execute cmd : npm init slidev

You can use https://sli.dev/new to create a new project to reproduce the issue.

Environment

owen-kuai commented 2 months ago

work around: The code runs successfully with npm version 10.2.3 and node version v20.10.0 The node version in the readme.md file should be updated to specify the currently working version