Ansible command module with nvm
<p>I am trying to execute this command using Ansible:</p>

<pre><code>- name: install node v5.5.0
  sudo: yes
  shell: nvm ls-remote
  environment:
    http_proxy: http://17.99.193.229:3128
    https_proxy: http://17.99.193.229:3128
</code></pre>

<p>I tried shell and command.  </p>

<p>When using command:  I got this error:</p>

<pre><code>"[Errno 2] No such file or directory", "rc": 2"
</code></pre>

<p>When using shell: I got this error:</p>

<pre><code>"fatal: [gocdagent-dev-01.rno.apple.com]: FAILED! =&gt; {"changed": true, "cmd": "nvm ls-remote", "delta": "0:00:00.016365", "end": "2016-05-16 18:26:07.259729", "failed": true, "rc": 127, "start": "2016-05-16 18:26:07.243364", "stderr": "/bin/sh: nvm: command not found", "stdout": "", "stdout_lines": [], "warnings": []}"
</code></pre>

<p>I can execute <code>nvm</code> command directly on the system. Why can't Ansible run <code>nvm</code>? </p>