Common pnpm Commands
Common pnpm Commandsβ
# install dependencies
pnpm i
pnpm i <package>
pnpm add -g <package>
pnpm add -D <package>
# -D or --save-dev means installing the package as a development dependency, which means the package is only used during development and not needed in production. Development dependencies usually include testing tools, build tools, packaging tools, etc.
# -P or --save-prod means installing the package as a production dependency, which means the package is required when running in production. Production dependencies include the application's core functions and dependencies.
# Show outdated packages and their current versions.
pnpm outdated
# update all the outdated dependencies
pnpm update --latest
# Update all packages to their latest versions based on the version ranges specified in the package.json file.
# do not use it for normal situations, as it may introduce breaking changes.
# for best practice to use this, then delete pnpm-lock.yaml and run pnpm install again.
pnpm update
# Run a script defined in the scripts section of the package.json file.
pnpm run <script>
# Uninstall a package and remove it from the package.json file.
pnpm uninstall <package>
# Remove extraneous packages not listed in the package.json file.
pnpm prune
# Force update pnpm-lock.yaml
pnpm install --no-frozen-lockfile
Problemsβ
GET https://registry.npm.taobao.org/pnpm error (CERT_HAS_EXPIRED). Will retry in 10 seconds. 2 retries left.

Just delete the directory,display on the console C:\Users\xx\AppData\Local\pnpm
Agreement
The code part of this work is licensed under Apache License 2.0 . You may freely modify and redistribute the code, and use it for commercial purposes, provided that you comply with the license. However, you are required to:
- Attribution: Retain the original author's signature and code source information in the original and derivative code.
- Preserve License: Retain the Apache 2.0 license file in the original and derivative code.
- Attribution: Give appropriate credit, provide a link to the license, and indicate if changes were made.
- NonCommercial: You may not use the material for commercial purposes. For commercial use, please contact the author.
- ShareAlike: If you remix, transform, or build upon the material, you must distribute your contributions under the same license as the original.