【发布时间】:2019-06-28 10:06:58
【问题描述】:
我正在尝试在 Ubuntu 18.04.2 LTS 上使用 ansible playbook 脚本安装 npm 和 nvm。它正在安装,但在运行 npm install 命令时返回错误["/bin/bash: npm: command not found"]
这是脚本
- name: Create destination dir if it does not exist
file:
mode: 0775
path: "/usr/local/nvm"
state: directory
when: "nvm_dir != ''"
- name: Install NVM
shell: "curl https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | NVM_SOURCE="" NVM_DIR=/usr/local/nvm PROFILE=/root/.bashrc bash"
args:
warn: false
register: nvm_result
这是我获取代码的存储库 (https://github.com/morgangraphics/ansible-role-nvm)
【问题讨论】: