Installation
Install better-ts-stack globally or run on-demand with npx
Installation Methods
Method 1: npx (Recommended)
Run without installing anything:
npx better-ts-stackPros
- Always fetches the latest published version
- No global installation needed
- No permission issues
Cons
- Slight startup delay on the first run (downloads the package)
- Requires an internet connection
Method 2: Global install
Install once and run from anywhere:
bash npm install -g better-ts-stack better-ts-stack
Pros
- Faster execution on repeat runs
- Works offline after first install
Cons
- Manual update required (
npm update -g better-ts-stack) - May require elevated permissions on some systems
Update a global install: npm update -g better-ts-stack
Method 3: pnpm dlx / bunx
Equivalent to npx for pnpm and Bun users:
pnpm dlx better-ts-stack
# or
bunx better-ts-stackTroubleshooting
"Command not found" after global install
Your package manager's global bin directory may not be in your PATH.
# Find where npm installs global packages
npm config get prefix
# Add <prefix>/bin to your shell profile (~/.bashrc or ~/.zshrc):
export PATH="$PATH:$(npm config get prefix)/bin"Permission errors on Linux / macOS
Avoid running npm with sudo. Instead, configure npm to use a user-writable directory:
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
source ~/.bashrc
# Now install without sudo
npm install -g better-ts-stackWhich Method Should You Use?
| Scenario | Recommended method |
|---|---|
| First time trying it | npx better-ts-stack |
| Frequent everyday use | Global install |
| CI/CD pipeline | npx better-ts-stack |
| Specific version pinned | npx [email protected] |