Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
owen-kuai opened this issue Sep 2, 2024 · 1 comment · May be fixed by #1849

Comments

@owen-kuai
Copy link

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

  • node: v18.7.0
  • npm: 8.15.0
  • Slidev version: 7504bb5
  • Browser: chrom
  • OS: macOS 12.4
@owen-kuai
Copy link
Author

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

@KermanX KermanX linked a pull request Sep 2, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants