One command to use any* package manager
https://github.com/leog/package-manager-alias-cli.git
One command to use any\* package manager. A universal CLI that auto-detects and uses npm, yarn, pnpm, or bun.
npm install -g package-manager-alias-cli
Or with other package managers:
yarn global add package-manager-alias-cli
pnpm add -g package-manager-alias-cli
bun add -g package-manager-alias-cli
Go to any Node.js project and use pm instead of your package manager:
# Instead of npm install / yarn install / pnpm install / bun install
pm install
# Instead of npm add lodash / yarn add lodash / pnpm add lodash / bun add lodash
pm add lodash
# Run scripts
pm run build
pm run test
# Any command works!
pm outdated
pm update
pm remove lodash
-v, --version Show version number
-h, --help Show help message
--verbose Show which package manager is being used
# Check the version
pm --version
# See help
pm --help
# See which package manager is detected
pm --verbose install
# Output: Detected package manager: yarn
# yarn install v1.22.19
# ...
The tool detects your package manager in this priority order:
yarn.lock โ yarnpackage-lock.json โ npmpnpm-lock.yaml โ pnpmbun.lockb โ bunyarn, pnpm, or bun command existsnpm if none are foundThis error occurs when you're not in a Node.js project directory. Make sure:
package.json file in the current directorypackage-lock.json, yarn.lock, pnpm-lock.yaml, or bun.lockb)The tool prioritizes lockfiles. If you want to switch package managers:
pm install to generate a new lockfile with your preferred package managerMake sure the package is installed globally:
npm install -g package-manager-alias-cli
Then verify it's in your PATH:
which pm
Contributions are welcome! Please read our Contributing Guide for details.
See CHANGELOG.md for a list of changes.
MIT - Leo Giovanetti