goooseman.nvm

nvm

Downloads Linting Status Test Status

This document explains how to install nvm (Node Version Manager) and Node.js.

Note: This version works with Rosetta 2 for installing Node.js on Apple Silicon Macs.

What You Need

You need the following tools: git, curl, build-essential, and libssl-dev. The installation role will take care of these for you.

Role Variables

  • nvm_version: Specify the nvm version (e.g., tag, HEAD, master, or latest). Default is 0.39.7.
  • nvm_node_version: Specify the Node.js version (e.g., 12.16.0 or keywords like lts or latest). Default is 20.14.0.
  • nvm_install_path: The folder path for nvm. You can use an absolute or relative path. Default is ~/.nvm.
  • nvm_shell_init_file: The Shell initialization file where nvm will be sourced. Default is ~/.profile.
  • nvm_force_install: A true/false option. If set to true, it will reinstall nvm from git if files in nvm_install_path are changed. Default is false.
  • nvm_install_deps: A true/false option. If set to false, it skips installing dependencies and can run as a non-root user. Default is true.

Dependencies

No additional dependencies are needed.

Sample Playbook

To install a specific version:

- hosts: servers
  roles:
    - role: stephdewit.nvm
      nvm_version: 0.4.0
      nvm_node_version: 0.10

To always install the latest version:

- hosts: servers
  roles:
    - role: stephdewit.nvm
      nvm_version: 'latest'
      nvm_node_version: 'latest'

If you are using a different user than the one currently logged in, you may need to set the NVM_DIR environment variable with an absolute path:

- hosts: servers
  roles:
    - role: stephdewit.nvm
      become: yes
      become_user: vagrant
      environment:
        NVM_DIR: /home/vagrant/.nvm

License

This project is licensed under the BSD license.

Author Information

Informazioni sul progetto

Install nvm and Node.js.

Installa
ansible-galaxy install goooseman.nvm
Licenza
Unknown
Download
2.1k
Proprietario
A senior engineer experienced in building scalable projects from scratch, maintaining legacy ones and building teams.