$pm add vite
# should be success
$pm run vite --version
# shoud be fail
$pm run esbuild --versionvite has 4 transitive binaries vite, rollup, esbuild and nanoid.
A user expects only vite available when installing vite using package manager. (especially when installing for global $PATH) However, its behavior is vary
- NPM downloads all of them into
node_modules/.binand link all of them to project /$PATH - Yarn downloads all of them into
node_modules/.binbut link onlyvitein the project /$PATH - pnpm downloads only
viteintonode_modules/bin, and link onlyvitein the project /$PATH - Bun downloads all of them into
node_moudles/.bin, and link all of them to proejct /$PATH
Due to its behavior, NPM and Bun is not good for managing global installations. It could be a security risk (supply chain attacks) and it can bloats the completions on shell environment.
Thanks! 👍