community.general.pnpm module – Manage node.js packages with pnpm
Note
This module is part of the community.general collection (version 9.4.0).
It is not included in ansible-core
.
To check whether it is installed, run ansible-galaxy collection list
.
To install it, use: ansible-galaxy collection install community.general
.
You need further requirements to be able to use this module,
see Requirements for details.
To use it in a playbook, specify: community.general.pnpm
.
New in community.general 7.4.0
Synopsis
Manage node.js packages with the pnpm package manager.
Requirements
The below requirements are needed on the host that executes this module.
Pnpm executable present in
PATH
.
Parameters
Parameter |
Comments |
---|---|
Alias of the node.js library. |
|
Install dependencies in development mode. Pnpm will ignore any regular dependencies in Choices:
|
|
The executable location for pnpm. The default location it searches for is |
|
Install the node.js library globally. Choices:
|
|
Use the Choices:
|
|
The name of a node.js library to install. All packages in package.json are installed if not provided. |
|
Do not install optional packages, equivalent to Choices:
|
|
Install dependencies in optional mode. Choices:
|
|
The base path to install the node.js libraries. |
|
Install dependencies in production mode. Pnpm will ignore any dependencies under Choices:
|
|
Installation state of the named node.js library. If Choices:
|
|
The version of the library to be installed, in semver format. |
Attributes
Attribute |
Support |
Description |
---|---|---|
Support: full |
Can run in |
|
Support: none |
Will return details on what has changed (or possibly needs changing in |
Examples
- name: Install "tailwindcss" node.js package.
community.general.pnpm:
name: tailwindcss
path: /app/location
- name: Install "tailwindcss" node.js package on version 3.3.2
community.general.pnpm:
name: tailwindcss
version: 3.3.2
path: /app/location
- name: Install "tailwindcss" node.js package globally.
community.general.pnpm:
name: tailwindcss
global: true
- name: Install "tailwindcss" node.js package as dev dependency.
community.general.pnpm:
name: tailwindcss
path: /app/location
dev: true
- name: Install "tailwindcss" node.js package as optional dependency.
community.general.pnpm:
name: tailwindcss
path: /app/location
optional: true
- name: Install "tailwindcss" node.js package version 0.1.3 as tailwind-1
community.general.pnpm:
name: tailwindcss
alias: tailwind-1
version: 0.1.3
path: /app/location
- name: Remove the globally-installed package "tailwindcss".
community.general.pnpm:
name: tailwindcss
global: true
state: absent
- name: Install packages based on package.json.
community.general.pnpm:
path: /app/location
- name: Update all packages in package.json to their latest version.
community.general.pnpm:
path: /app/location
state: latest