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

Check if @types/node is in sync with latest node version in the tutorial #30

Closed
ayyrickay opened this issue Oct 24, 2024 · 1 comment · Fixed by #32
Closed

Check if @types/node is in sync with latest node version in the tutorial #30

ayyrickay opened this issue Oct 24, 2024 · 1 comment · Fixed by #32
Labels
bug 🐜 Something isn't working create-app 📂 Relates to the @stricli/create-app package

Comments

@ayyrickay
Copy link

ayyrickay commented Oct 24, 2024

Is your feature request related to a problem? Please describe.
Using the latest version of Node, I tried installing the dependencies for the tutorial and understandably got the following error, because node types is behind the current version of node:

npm error code ETARGET
npm error notarget No matching version found for @types/node@23.x.
npm error notarget In most cases you or one of your dependencies are requesting
npm error notarget a package version that doesn't exist.
npm error A complete log of this run can be found in:

Describe the solution you'd like
Changing the version of @types/node isn't particularly hard, but it's a bit annoying. It looks the tutorial installation tracks to the current version of node, but it would be great if it could be aware that node and node types can fall out of sync.

If there's a way to pull the latest node types and compare it to the installed version of node, that might provide sufficient information to handle this edge case. Something like:

node version <= node types latest ? use node version : use node types

Describe alternatives you've considered
Just using the latest node types won't work, since I assume most developers aren't using the latest version. You really just need to see that case where the node types are behind the latest node version.

@molisani molisani added bug 🐜 Something isn't working create-app 📂 Relates to the @stricli/create-app package labels Oct 24, 2024
@molisani
Copy link
Member

This is a case of Stricli trying to be too clever and getting bit ☹️. I always assumed that @types/node tracked Node major versions pretty closely, but that doesn't seem to be the case. For Node 22 it was released 24-Apr-2024 and the matching @types/node@22 wasn't released until 28-Jul-2024.

We definitely don't want the types to break right out of the gate for a new project, even if it's using a brand-new Node version, so this should definitely be fixed. I think your proposed solution is probably the most straightforward, but I'd prefer to not add a dependency on the user's npm registry if at all possible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐜 Something isn't working create-app 📂 Relates to the @stricli/create-app package
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants