use-pnpm
v1.0.3
Published
Automatically fetch the latest pnpm version and set packageManager field
Readme
use-pnpm
A simple CLI tool that automatically fetches the latest pnpm version and sets the packageManager field in your package.json.
Usage
Run in your project directory:
npx use-pnpmThe tool will automatically:
- Fetch the latest pnpm version from npm registry
- Find
package.jsonin the current directory (or traverse up) - Set or update the
packageManagerfield topnpm@<latest-version>
Example Output
ℹ Fetching latest pnpm version...
ℹ Latest pnpm version: 10.26.2
ℹ Found package.json: /foo/bar/baz/package.json
✔ packageManager is already up to date: [email protected]
ℹ Executing pnpm -v to trigger Corepack download...
10.26.2Why?
The packageManager field works with Corepack to ensure all team members use the same package manager version, avoiding issues caused by version differences.
License
Copyright (c) 2025-present, Zhifeng (Jeff) Wang
