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

corepack use fails with ENOENT: no such file or directory, open '/app/package.json' #347

Closed
styfle opened this issue Jan 4, 2024 · 3 comments · Fixed by #350
Closed

Comments

@styfle
Copy link
Member

styfle commented Jan 4, 2024

When a package.json file is missing, corepack use fails with ENOENT.

I think it would be great if corepack could create the package.json file when its missing.

It would avoid the need to call npm init -y, yarn init -y, or pnpm init in some cases.

@aduh95
Copy link
Contributor

aduh95 commented Jan 4, 2024

What do you think should be the behavior? Should Corepack call <pkg-manager> init in such case? Or just create a package.json with only the "packageManager" field?

@styfle
Copy link
Member Author

styfle commented Jan 5, 2024

The second option - create package.json directly with one field.

Interesting idea to call init though. Seems like that could be implemented under a different sub command however. Keep “use” simple.

@styfle
Copy link
Member Author

styfle commented Jan 12, 2024

@aduh95 Thanks for the quick fix! 🎉

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