community.general.pnpm (8.5.0) — module

Manage node.js packages with pnpm

| "added in version" 7.4.0 of community.general"

Authors: Aritra Sen (@aretrosen), Chris Hoffman (@chrishoffman), creator of NPM Ansible module

Install collection

Install with ansible-galaxy collection install community.general:==8.5.0


Add to requirements.yml

  collections:
    - name: community.general
      version: 8.5.0

Description

Manage node.js packages with the L(pnpm package manager, https://pnpm.io/).


Requirements

Usage examples

  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "tailwindcss" node.js package.
  community.general.pnpm:
    name: tailwindcss
    path: /app/location
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "tailwindcss" node.js package on version 3.3.2
  community.general.pnpm:
    name: tailwindcss
    version: 3.3.2
    path: /app/location
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "tailwindcss" node.js package globally.
  community.general.pnpm:
    name: tailwindcss
    global: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "tailwindcss" node.js package as dev dependency.
  community.general.pnpm:
    name: tailwindcss
    path: /app/location
    dev: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install "tailwindcss" node.js package as optional dependency.
  community.general.pnpm:
    name: tailwindcss
    path: /app/location
    optional: true
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- 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
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Remove the globally-installed package "tailwindcss".
  community.general.pnpm:
    name: tailwindcss
    global: true
    state: absent
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Install packages based on package.json.
  community.general.pnpm:
    path: /app/location
  • Success
    Steampunk Spotter scan finished with no errors, warnings or hints.
- name: Update all packages in package.json to their latest version.
  community.general.pnpm:
    path: /app/location
    state: latest

Inputs

    
dev:
    default: false
    description:
    - Install dependencies in development mode.
    - Pnpm will ignore any regular dependencies in C(package.json).
    required: false
    type: bool

name:
    description:
    - The name of a node.js library to install.
    - All packages in package.json are installed if not provided.
    required: false
    type: str

path:
    description:
    - The base path to install the node.js libraries.
    required: false
    type: path

alias:
    description:
    - Alias of the node.js library.
    required: false
    type: str

state:
    choices:
    - present
    - absent
    - latest
    default: present
    description:
    - Installation state of the named node.js library.
    - If V(absent) is selected, a name option must be provided.
    required: false
    type: str

global:
    default: false
    description:
    - Install the node.js library globally.
    required: false
    type: bool

version:
    description:
    - The version of the library to be installed, in semver format.
    required: false
    type: str

optional:
    default: false
    description:
    - Install dependencies in optional mode.
    required: false
    type: bool

executable:
    description:
    - The executable location for pnpm.
    - The default location it searches for is E(PATH), fails if not set.
    required: false
    type: path

production:
    default: false
    description:
    - Install dependencies in production mode.
    - Pnpm will ignore any dependencies under C(devDependencies) in package.json.
    required: false
    type: bool

no_optional:
    default: false
    description:
    - Do not install optional packages, equivalent to C(--no-optional).
    required: false
    type: bool

ignore_scripts:
    default: false
    description:
    - Use the C(--ignore-scripts) flag when installing.
    required: false
    type: bool