community / community.general / 0.1.4 / module / npm Manage node.js packages with npm Authors: Chris Hoffman (@chrishoffman)community.general.npm (0.1.4) — module
Install with ansible-galaxy collection install community.general:==0.1.4
collections: - name: community.general version: 0.1.4
Manage node.js packages with Node Package Manager (npm)
- name: Install "coffee-script" node.js package. npm: name: coffee-script path: /app/location
- name: Install "coffee-script" node.js package on version 1.6.1. npm: name: coffee-script version: '1.6.1' path: /app/location
- name: Install "coffee-script" node.js package globally. npm: name: coffee-script global: yes
- name: Remove the globally package "coffee-script". npm: name: coffee-script global: yes state: absent
- name: Install "coffee-script" node.js package from custom registry. npm: name: coffee-script registry: 'http://registry.mysite.com'
- name: Install packages based on package.json. npm: path: /app/location
- name: Update packages based on package.json to their latest version. npm: path: /app/location state: latest
- name: Install packages based on package.json using the npm installed with nvm v0.10.1. 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 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 unsafe_perm: default: false description: - Use the C(--unsafe-perm) flag when installing. type: bool ignore_scripts: default: false description: - Use the C(--ignore-scripts) flag when installing. required: false type: bool