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

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v4' is not defined by "exports" package.json #594

Closed
CSharpDaddy opened this issue Nov 11, 2021 · 5 comments

Comments

@CSharpDaddy
Copy link

Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './v4' is not defined by "exports" in C:\Users\jaden\Desktop\Hye\node_modules\uuid\package.json

Does anyone know why this is happening? Im using the latest node.js version

@LinusU
Copy link
Member

LinusU commented Nov 11, 2021

Are you doing import ... from 'uuid/v4' anywhere in your code?

@ctavan
Copy link
Member

ctavan commented Dec 2, 2021

Please check the discussion in #584. Issues like this are with absolute certainty due to badly defined dependency version ranges. Please make sure that your code and all dependencies you are using make proper use of Semantic Versioning version ranges.

The whole purpose of Semantic Versioning is to provide library authors with a way for safely introducing breaking changes, and developers with a safe way of dealing with such changes by specifying appropriate dependency version ranges.

If we start supporting legacy forever just because some other library or application specifies dependencies in a wrong way it would defeat the original purpose of Semantic Versioning.

We will therefore not start fixing other people's code by re-introducing technical debt.

@ctavan ctavan closed this as completed Dec 2, 2021
@tchakabam
Copy link

tchakabam commented Dec 3, 2021

"and all dependencies you are using "

even if one finds that they aren't doing this right in any deps, do you expect people to fork all these deps etc? :)

this is what i meant by idealistic concepts in another post on SO regarding this :)

yes, you can break things in major versions. in theory :) because you also expect here that people will use ranges in the according way. which in practical reality (unfortunately) is not the case.

We will therefore not start fixing other people's code by re-introducing technical debt.

i dont know what you mean by "technical debt" here. to me all this is just syntactical sugar for one or the other way to express a JS import honestly :D it's not really a feature of any library itfp i would say.

i get your point philosophicaly but i dont find it very pragmatic.

either way, i dont care what is done here. i already said that i found a solution to the problem for our case. i just wanted to help you with providing the data i posted before.

you dont need to come up with grand justifications for how you proceed on the matter.

@LinusU
Copy link
Member

LinusU commented Dec 4, 2021

even if one finds that they aren't doing this right in any deps, do you expect people to fork all these deps etc? :)

Realistically, it's probably only one package that accidentally used the wrong range. Should be as easy to fix that package with a PR, as sending a PR to this repo.

[...] because you also expect here that people will use ranges in the according way. which in practical reality (unfortunately) is not the case.

I think that this is a very very rare occurrence. Npm automatically uses the correct ranges when you run npm install, and I've never worked in a project that doesn't use ranges.

Are you really suggeting that no package on npm can ever make any breaking changes?

either way, i dont care what is done here. i already said that i found a solution to the problem for our case. i just wanted to help you with providing the data i posted before.

Something that would really help is seeing which package is actually broken. Could you run npm ls uuid and post the result here?

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

4 participants