Skip to content

fix: use open-cli instead of require('open') for Node 20+ compatibility #10517

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Ashutoshyadav01
Copy link

This PR fixes the error when running npm start on Node.js 20+ caused by using require('open'), which no longer works due to open being ESM-only.

✅ Replaced:
"open-static": "node -e "require('open')('http://localhost:3002')\""

✅ With:
"open-static": "npx open-cli http://localhost:3002"

✅ Also added open-cli as a dev dependency.

Fixes #10516

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 this pull request may close these issues.

Bug: npm start fails due to ESM open package in Node 20+
1 participant