community.general.pnpm module – Manage Node.js packages with pnpm
Note
This module is part of the community.general collection (version 10.7.5).
You might already have this collection installed if you are using the ansible package.
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 ignores 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  | |
| 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 ignores 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
