community / community.general / 6.6.8 / module / npm Manage node.js packages with npm Authors: Chris Hoffman (@chrishoffman)community.general.npm (6.6.8) — module
Install with ansible-galaxy collection install community.general:==6.6.8
collections: - name: community.general version: 6.6.8
Manage node.js packages with Node Package Manager (npm).
- name: Install "coffee-script" node.js package. community.general.npm: name: coffee-script path: /app/location
- name: Install "coffee-script" node.js package on version 1.6.1. community.general.npm: name: coffee-script version: '1.6.1' path: /app/location
- name: Install "coffee-script" node.js package globally. community.general.npm: name: coffee-script global: true
- name: Remove the globally package "coffee-script". community.general.npm: name: coffee-script global: true state: absent
- name: Install "coffee-script" node.js package from custom registry. community.general.npm: name: coffee-script registry: 'http://registry.mysite.com'
- name: Install packages based on package.json. community.general.npm: path: /app/location
- name: Update packages based on package.json to their latest version. community.general.npm: path: /app/location state: latest
- name: Install packages based on package.json using the npm installed with nvm v0.10.1. community.general.npm: path: /app/location executable: /opt/nvm/v0.10.1/bin/npm state: present
ci: default: false description: - Install packages based on package-lock file, same as running C(npm ci). type: bool name: description: - The name of a node.js library to install. required: false type: str path: description: - The base path where to install the node.js libraries. required: false type: path state: choices: - present - absent - latest default: present description: - The state of the node.js library. required: false type: str global: default: false description: - Install the node.js library globally. required: false type: bool version: description: - The version to be installed. required: false type: str registry: description: - The registry to install modules from. required: false type: str executable: description: - The executable location for npm. - This is useful if you are using a version manager, such as nvm. required: false type: path production: default: false description: - Install dependencies in production mode, excluding devDependencies. required: false type: bool no_optional: default: false description: - Use the C(--no-optional) flag when installing. type: bool version_added: 2.0.0 version_added_collection: community.general unsafe_perm: default: false description: - Use the C(--unsafe-perm) flag when installing. type: bool no_bin_links: default: false description: - Use the C(--no-bin-links) flag when installing. type: bool version_added: 2.5.0 version_added_collection: community.general ignore_scripts: default: false description: - Use the C(--ignore-scripts) flag when installing. required: false type: bool