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
fix(nuxt): add @types/node
as a peerDependency
#20025
Conversation
Β Open in CodeSandbox Web Editor | VS Code | VS Code Insiders |
β Live Preview ready!
|
β Live Preview ready!
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me π
Can't we do this simply by adding Peer dependency behavior of package managers is sometimes annoying we never added them to |
Could we do both (add as peerDep and also in starter)? |
Isnβt it enough to add dev dependencies to starter templates to fix the issues? |
I think it would fix the issue for new projects, but not affect existing ones. What are you worried that this change might do? |
We could simply instruct old projects to install both typescript and @types/node packages as currently documented if this change is purely for them. I am even up to supporting nuxi typescript setup command to automate local ts setup :) Package managers never had a persistent and predictable behavior with peer dependency handling. We might need to always keep updating a new range for supported node and for (even small!) fragment of users are not using typescript, it is just an additional dependency forced to install (or see warn) |
You're right, we would need to keep updating the range. But we currently need to do the exact same thing for Of course we can tell people to add the dependency themselves (and we should). But I think this is exactly the purpose for which we have peerDeps, right? I'm still not sure what disadvantages there would be to this. I'm not suggesting adding I am very happy to revert this change (or enable |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TBH I'm still not 100% convinced this is the best way to solve the issue with peerDependencies while simply should be solved in starter (and anyway we need to add devDependency there too) but let's try doing it...
@types/node
as a peerDep@types/node
as a peerDependency
I'm still receiving this error after upgrading to v3.4.0. I've also installed @types/node manually as well. |
@kpetrillo I'm not sure what issue you're referring to. Would you create a new issue - with a reproduction? |
π Linked issue
β Type of change
π Description
This aims to improve DX by installing
@types/node
by default (but respecting user's preference if they install a different version, to match their own node version).π Checklist