This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.
- name:'Remove any node modules'
file:
path:'{{ remote_dir }}/node_modules'
state:absent
- vars:
# sample: node-v8.2.0-linux-x64.tar.xz
node_path:'{{ remote_dir}}/{{ nodejs_path }}/bin'
package:'iconv-lite'
block:
- shell:npm --version
environment:
PATH:'{{ node_path }}:{{ ansible_env.PATH }}'
register:npm_version
- debug:
var:npm_version.stdout
- name:'Install simple package without dependency'
npm:
path:'{{ remote_dir }}'
executable:'{{ node_path}}/npm'
state:present
name:'{{ package }}'
environment:
PATH:'{{ node_path}}:{{ansible_env.PATH }}'
register:npm_install
- assert:
that:
- npm_install is success
- npm_install is changed
- name:'Reinstall simple package without dependency'