vite icon indicating copy to clipboard operation
vite copied to clipboard

Install options/guide

Open garikAsplund opened this issue 1 year ago • 3 comments

Documentation is

  • [X] Missing
  • [ ] Outdated
  • [X] Confusing
  • [ ] Not sure?

Explain in Detail

Is there any installation procedure or am I missing something? I know that you can create projects via npm and all the other package managers and that's all well and good. I've done that before and never had an issue.

But, I needed to do something outside of a project with it couldn't find any documentation on how to do that. Searching 'install' on the website just leads you to projects that use Netlify and how to install that. Seems strange. So I installed Vite via homebrew.

A simple rundown of the overall situation could be helpful. Or a 'If you need to, install on your machine with brew install vite'?

Your Suggestion for Changes

Any info about installing Vite itself would de nice.

Reproduction

No response

Steps to reproduce

No response

garikAsplund avatar May 03 '24 01:05 garikAsplund

Vite is only distributed as an npm package. You need to use npm install vite if you want to use Vite, similar to the scaffolded project. I suppose we can add a small section regarding manual installation of Vite. Installing Vite from homebrew is not recommended.

bluwy avatar May 13 '24 07:05 bluwy

Ok, that checks out. As I said, using it for projects I've never had an issue, I just needed to do run some command and couldn't find Vite globally. Why is it not recommended via brew?

garikAsplund avatar May 13 '24 17:05 garikAsplund

Using homebrew, or synonymously with npm install -g vite, installs Vite globally. When working with npm packages, it's usually recommended to install things per-project (with a package.json) so Vite is versioned and you control when to upgrade it. Otherwise when Vite cuts a new major, it'll break things.

bluwy avatar May 14 '24 06:05 bluwy

Would a good place to mention npm install vite and npm install -g vite (as well as their yarn equivalents yarn add vite and yarn global add vite) be https://vitejs.dev/guide/ aka https://github.com/vitejs/vite/blob/main/docs/guide/index.md ? I can start a quick PR to at least get feedback/input.

hchiam avatar Jun 06 '24 01:06 hchiam

PR ready for review (again): https://github.com/vitejs/vite/pull/17404

hchiam avatar Jun 13 '24 23:06 hchiam