---
- name: get the node path
  shell: source ~/.nvm/nvm.sh && dirname $(which node)
  register: node_path
  args:
    executable: /bin/bash
- name: install packages
  npm: name={{ item }} global=yes state=present executable="{{node_path.stdout}}/npm"
  with_items:
    - npm-check-updates
    - pm2
    - commitizen
    - resin-cli
  environment:
    PATH: "{{ ansible_env.PATH }}:{{node_path.stdout}}"

---
- name: get the node path
  shell: source ~/.nvm/nvm.sh && dirname $(which node)
  register: node_path
  args:
    executable: /bin/bash
- name: install packages
  npm:
    name: {{item}}
    global: true
    state: present
    executable: "{{node_path.stdout}}/npm"
  with_items:
    - npm-check-updates
    - commitizen
  environment:
    PATH: "{{ ansible_env.PATH }}:{{node_path.stdout}}"

Remove some unused npm packages
Remove some unused npm packages
