#install vite globally

1 messages · Page 1 of 1 (latest)

rotund aspen
#

i want to install vite globally, like i do with rollup. is that a good idea? i wonder because in the guide there is no comment about global install.

dark oasis
#

answered at <#discussions message>. please dont crosspost

rotund aspen
#

that link just says "global is almost always bad". i would prefer a reason(s). I always use rollup and typescript withglobal installs and that works perfect. no need to hear about general localvs global, just about vite. eg why is it differentto rollup, where many are happy with global installs?

daring frost
#

NPM themselves recommend using npx instead of global packages:

Tip: If you are using npm 5.2 or higher, we recommend using npx to run packages globally.

#

Personally, and maybe most devs, prefer to use local packages. In a package.json you can add scripts that utilize the local package.

dark oasis
#

vite can work in a global install like rollup. we don't document it due to the general global caveats you mentioned