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

missing name property in package.json file? #13107

Closed
farskid opened this issue Jun 25, 2018 · 2 comments
Closed

missing name property in package.json file? #13107

farskid opened this issue Jun 25, 2018 · 2 comments

Comments

@farskid
Copy link

farskid commented Jun 25, 2018

Do you want to request a feature or report a bug?
It's neither a feature nor a bug report. maybe an invalid behaviour.

What is the current behavior?
In current package.json file, there is no property name which according to npm docs, it's required.

What is the expected behavior?
Unless there is a global configuration for it, is there a chance, it's missing and should be added?

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?
Latest version.

@TrySound
Copy link
Contributor

There is a name in package itself.
https://github.com/facebook/react/blob/master/packages/react/package.json

This package.json is private. It's not published and may not have a name.
https://github.com/facebook/react/blob/master/package.json

@farskid
Copy link
Author

farskid commented Jun 25, 2018

Thanks for clarifying @TrySound . I'm closing since it's resolved for me 👍

@farskid farskid closed this as completed Jun 25, 2018
tobni pushed a commit to pantsbuild/pants that referenced this issue Jul 11, 2024
…missing (#21159)

Closes #20859.

While this is a simple fix and addresses the linked issue, there is an
interesting edge case to discuss:

Internal packages do not necessarily have a name field in `package.json`
(see wireapp/wire-desktop#1692,
facebook/react#13107 for examples). The
JavaScript backend in Pants does require that each package.json define a
name, but I'm not so sure that's necessarily the right behavior.

It's worth considering whether we should make names optional in Pants,
given that larger JavaScript monorepos may have internal packages that
are not meant to be published. Furthermore, different JS package
managers handle this situation differently -

* [Bun doesn't handle package.json files without a
name](oven-sh/bun#6317)
* [npm assigns the parent directory name as the
name](npm/cli#2264)
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

No branches or pull requests

2 participants