macos-setup
🐱 Source ☕️ Java SampleGo Sample Angular Sample
  • Mac Setup
  • Getting Started
    • Xcode
    • Homebrew
    • System Preferences
    • Essentials
    • Dotfiles
  • Applications
    • Ghostty
    • Sublime-text
    • JetBrains
    • VSCode
    • Xcode
    • Marta
    • Benthos
    • OrbStack
    • Traefik
    • n8n
  • Platforms
    • Java
    • Node
      • Bub
      • NPM
      • PNPM
      • Turborepo
    • GoLang
    • Rust
    • Python
      • Agno AI
  • DevOps
    • Development Workflow
      • Git
        • GitHub CLL
      • GitOps
      • Documentation
      • mkcert
      • YubiKey
    • Monorepo
    • dnsmasq
    • Docker
    • Skaffold
    • Kubernetes
    • Helm
    • Kustomize
    • kustomizer
    • Terraform
    • Security
    • Cloud
      • gcloud
      • azure
      • aws
  • Tips
    • Git
    • MacOS
Powered by GitBook
On this page
  • Usage
  • Update
  • References

Was this helpful?

Edit on GitHub
  1. Platforms
  2. Node

NPM

Usage

# example installing packages globally. use `-g` flag
npm install -g npm-check-updates
npm install -g dynamodump --force 
# Write shell scripts with Google's [zx](https://github.com/google/zx)
npm install -g zx

Workspace

# Run "test" script on all packages
npm run test --workspaces

# Tip - this also works:
npm run test  -ws
# Runs "test" only on package-a
npm run test --workspace package-a

# Tip - this also works:
npm run test -w package-a
# Install `lodash` on `package-a`
npm install lodash --workspace package-a
npm install @nestjs/microservices --workspace apps/api

# Install `tap` on `package-b` as a dev dependency
npm install tap --workspace package-b --save-dev

# Install `package-a` on `package-b`
npm install package-a --workspace package-b

# Install `eslint` in all packages
npm install eslint --workspaces

Update

# To install major updates globally
npm install -g npm-check-updates

# To see a list of outdated packages
npm outdated

# To update the packages to their latest versions in package.json
ncu -u

# To install the new updates
npm update  or  npm install

References

PreviousBubNextPNPM

Last updated 2 years ago

Was this helpful?

Getting Started with npm Workspaces