Error saying "Failed to find required executable npm in paths"

0 votes

My ansible version:

ansible 2.5.0

When I run the playbook against "local" this works just fine, but if run from as remote using ssh, it fails and gives the following error:

Failed to find required executable npm in paths
Playbook:
- name: installing node
  homebrew:
    name: node
    state: present
    update_homebrew: yes

- name: Install appium from npm (always up to date)
  npm:
    name: appium
    state: latest
    global: yes
Jan 10 in Ansible by Thomas
103 views

1 answer to this question.

0 votes

Hey @Thomas, 

Seems like those extra paths have been configured in config files which are only readable by the interactive shell.

There's "path_helper" in Mac OS which is called on /etc/profile and seems to read /etc/paths and/or /etc/paths.d to set PATH properly but when running from an interactive non-login (or non interactive) shell /etc/profile is not sourced and that's why the PATH is different and hence the error. 

answered Jan 10 by Naina

Related Questions In Ansible

0 votes
1 answer
+13 votes
2 answers
0 votes
1 answer
0 votes
1 answer

Error saying "Invalid input (privileged mode required)" - Ansible

The task that generated this error requires to enable mode ...READ MORE

answered Mar 6 in Ansible by Yogesh
20 views