https://svelte.technology/guide#getting-started
It seems that the Getting started are a tad too far on the lean side.
svelte-clihas in implicit dependency to the svelte module so it needs to be installed as well, at leas on windows, or svelte-cli is not working.It is a bit said to have a 'Getting started' section be the first show stopper in looking into svelte.
Don't use svelte-cli manually. Use webpack or rollup plugins instead.
Until version 2, svelte-cli had svelte as a dependency, but that caused problems with people who had svelte-cli installed locally to their project but wanted to use a specific (i.e. the latest) version of svelte, without having to keep removing their node_modules and lock files.
So for v2 (released the other day), it was moved to peerDependencies... but that turns out to be worse, because it's likely you have the CLI installed globally which means it may not be able to find svelte. Honestly not sure what the right approach is.
@PaulMaly is right, you're much better off using a build tool with a plugin. I recommend starting here: https://svelte.technology/blog/the-easiest-way-to-get-started
You're entirely correct, our onboarding needs to improve. This is how these things evolve — you write a proof-of-concept CLI, then the first draft of the docs, then you start building the tools you really want, and write a blog post about it... and all along the out of date docs are just sitting there until someone comes along and points out how bad they are! We'll fix it.
I'll close this as there aren't any specific action points — there are plenty of issues on the docs repo already, and the svelte-cli bug is long fixed.
Most helpful comment
Until version 2,
svelte-clihadsvelteas a dependency, but that caused problems with people who hadsvelte-cliinstalled locally to their project but wanted to use a specific (i.e. the latest) version ofsvelte, without having to keep removing their node_modules and lock files.So for v2 (released the other day), it was moved to
peerDependencies... but that turns out to be worse, because it's likely you have the CLI installed globally which means it may not be able to findsvelte. Honestly not sure what the right approach is.@PaulMaly is right, you're much better off using a build tool with a plugin. I recommend starting here: https://svelte.technology/blog/the-easiest-way-to-get-started
You're entirely correct, our onboarding needs to improve. This is how these things evolve — you write a proof-of-concept CLI, then the first draft of the docs, then you start building the tools you really want, and write a blog post about it... and all along the out of date docs are just sitting there until someone comes along and points out how bad they are! We'll fix it.