Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Install pnpm package manager

License

NotificationsYou must be signed in to change notification settings

pnpm/action-setup

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

Repository files navigation

The v2 version of this actionhas stopped working with newer Node.js versions. Please, upgrade to the latest version to fix any issues.

Setup pnpm

Install pnpm package manager.

Inputs

version

Version of pnpm to install.

Optional when there is apackageManager field in thepackage.json.

otherwise, this field isrequired It supports npm versioning scheme, it could be an exact version (such as6.24.1), or a version range (such as6,6.x.x,6.24.x,^6.24.1,*, etc.), orlatest.

dest

Optional Where to store pnpm files.

run_install

Optional (default:null) If specified, runpnpm install.

Ifrun_install is eithernull orfalse, pnpm will not install any npm package.

Ifrun_install istrue, pnpm will install dependencies recursively.

Ifrun_install is a YAML string representation of either an object or an array, pnpm will execute every install commands.

run_install.recursive

Optional (type:boolean,default:false) Whether to usepnpm recursive install.

run_install.cwd

Optional (type:string) Working directory when runpnpm [recursive] install.

run_install.args

Optional (type:string[]) Additional arguments afterpnpm [recursive] install, e.g.[--ignore-scripts, --strict-peer-dependencies].

cache

Optional (type:boolean,default:false) Whether to cache the pnpm store directory.

cache_dependency_path

Optional (type:string|string[],default:pnpm-lock.yaml) File path to the pnpm lockfile, which contents hash will be used as a cache key.

package_json_file

Optional (type:string,default:package.json) File path to thepackage.json/package.yaml to read "packageManager" configuration.

standalone

Optional (type:boolean,default:false) When set to true,@pnpm/exe, which is a Node.js bundled package, will be installed, enabling usingpnpm without Node.js.

This is useful when you want to use a incompatible pair of Node.js and pnpm.

Outputs

dest

Expanded path of inputs#dest.

bin_dest

Location ofpnpm andpnpx command.

Usage example

Install only pnpm withoutpackageManager

This works when the repo either doesn't have apackage.json or has apackage.json but it doesn't specifypackageManager.

on:  -push  -pull_requestjobs:install:runs-on:ubuntu-lateststeps:      -uses:pnpm/action-setup@v4with:version:10

Install only pnpm withpackageManager

Omitversion input to use the version in thepackageManager field in thepackage.json.

on:  -push  -pull_requestjobs:install:runs-on:ubuntu-lateststeps:      -uses:pnpm/action-setup@v4

Install pnpm and a few npm packages

on:  -push  -pull_requestjobs:install:runs-on:ubuntu-lateststeps:      -uses:actions/checkout@v4      -uses:pnpm/action-setup@v4with:version:10run_install:|            - recursive:true              args: [--strict-peer-dependencies]            - args: [--global, gulp, prettier, typescript]

Use cache to reduce installation time

on:  -push  -pull_requestjobs:cache-and-install:runs-on:ubuntu-lateststeps:      -name:Checkoutuses:actions/checkout@v4      -uses:pnpm/action-setup@v4name:Install pnpmwith:version:10cache:true      -name:Install dependenciesrun:pnpm install

Note: You don't need to runpnpm store prune at the end; post-action has already taken care of that.

Notes

This action does not setup Node.js for you, useactions/setup-node yourself.

License

MIT ©Hoàng Văn Khải


[8]ページ先頭

©2009-2025 Movatter.jp