npm – Manage node.js packages with npm¶
Requirements¶
The below requirements are needed on the host that executes this module.
npm installed in bin path (recommended /usr/local/bin)
Parameters¶
Examples¶
- 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
Status¶
This module is not guaranteed to have a backwards compatible interface. [preview]
This module is maintained by the Ansible Community. [community]
Authors¶
Chris Hoffman (@chrishoffman)
Hint
If you notice any issues in this documentation, you can edit this document to improve it.