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

Add note about node version requirement #71

Closed
wants to merge 5 commits into from

Conversation

gtm-nayan
Copy link
Contributor

The Unexpected token '.' error has appeared quite a few times on discord and recently on the Kit issue tracker as well. Older node.js doesn't support optional chaining so starting the dev server fails with no changes to the starter template whatsoever. It isn't a great experience for new people if they have to go hunting for the fix.

I posted a screenshot on discord, that one had an extra line in it, but that should be fixed now, and it actually looks decent without the huge gap.

@benmccann
Copy link
Member

We specified Node 14 in the engines field of SvelteKit's package.json. That's supposed to stop people from running with old versions. If that's not working we should figure out why

@Conduitry
Copy link
Member

I think as of a while ago npm by default won't refuse to install when the engines requirement isn't met, but will instead only print a warning. This message, however, will likely get lost among a bunch of other innocuous warnings (e.g., about fsevents on non-macOS platforms, and about packages for prebuilt esbuild binaries for other platforms you're not currently on). npm (rightfully, I think) now leaves it up to the user whether they want to abort on unmet engines fields, rather than letting the package author decide for themselves.

So, in particular, I do get a message from npm on Node 12 currently, but I also get a bunch of other messages. I don't know what the correct answer is here. If we do want to explicitly document this somewhere, I think it should be somewhere more visible than a C-style comment in a block of commands to be executed in the terminal.

@@ -80,6 +80,7 @@

<div slot="how">
<pre><code>
// You'll need Node.js v14 or higher
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't JS so should use bash-style commenting

Suggested change
// You'll need Node.js v14 or higher
# You'll need Node.js v14 or higher

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aah right, fixed now.

gtm-nayan and others added 4 commits November 22, 2021 06:57
@gtm-nayan
Copy link
Contributor Author

gtm-nayan commented Nov 22, 2021

I also opted for a more muted color and italic text so it looks more like a comment. Chrome says the contrast ratio (5.28) should be fine.
image

I'm not too familiar with git, so let me know if there is any cleanup work to be done there.

@gtm-nayan
Copy link
Contributor Author

I think it should be somewhere more visible than a C-style comment in a block of commands to be executed in the terminal.

Wouldn't it be the most visible here since this is where most people will learn the installation process for the first time?

@gtm-nayan gtm-nayan requested a review from benmccann November 22, 2021 02:01
@benmccann
Copy link
Member

benmccann commented Nov 24, 2021

The fact that npm install is not failing looks like a bug on SvelteKit's side: sveltejs/kit#2952

@benmccann
Copy link
Member

I'm going to close this in favor of the SvelteKit bug. If we decide we can't fix the SvelteKit bug for some reason then we can revisit this

@benmccann benmccann closed this Dec 1, 2021
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 this pull request may close these issues.

3 participants