User:Aron Manning/Global npm modules
Installing node modules globally[edit]
Pnpm is an alternative to npm that stores packages in a global folder (`<mount point>/.pnpm-store` on the same drive) and (sym)links them from `node_modules`, thus saving install time and space requirement. Works on *nixes (using symlinks) and windows (using junctions) too.
# To use, install pnpm once (globally):
npx pnpm add -g pnpm
pnpm install-completion
# To update later:
pnpm add -g pnpm
# Install the packages:
`pnpm i`
This generates `pnpm-lock.yaml`, which is not committed to repository now. Add it to `.git/info/exclude`.
Npm scripts can be executed as usual (`npm run ...`) or using pnpm for concise and more readable error messages (`pnpm run ...`). Scripts in `package.json` still use `npm` to run subscripts, that does not change.