跳到主要内容

pnpm常用命令

pnpm常用命令

# install dependencies
pnpm install
pnpm i

pnpm install <package>
pnpm i <package>

pnpm install --global <package>
pnpm add -g <package>

pnpm install --save-dev <package>
pnpm add -D <package>
# -D 或 --save-dev 表示将包安装为开发依赖项,这意味着该包只在开发过程中使用,而在生产环境中并不需要。开发依赖项通常包括测试工具、构建工具、打包工具等,这些在实际运行应用时并不需要。
# -P 或 --save-prod 表示将包安装为生产依赖项,这意味着该包在生产环境中运行时是必需的。生产依赖项包括应用程序的核心功能和依赖项。

# 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.
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

Problems

GET https://registry.npm.taobao.org/pnpm error (CERT_HAS_EXPIRED). Will retry in 10 seconds. 2 retries left.

image.png

Just delete the directory,display on the console C:\Users\xx\AppData\Local\pnpm