{"id":13654994,"url":"https://github.com/geerlingguy/ansible-role-nodejs","last_synced_at":"2025-05-15T09:05:45.154Z","repository":{"id":14743195,"uuid":"17464230","full_name":"geerlingguy/ansible-role-nodejs","owner":"geerlingguy","description":"Ansible Role - Node.js","archived":false,"fork":false,"pushed_at":"2025-01-31T03:25:25.000Z","size":95,"stargazers_count":414,"open_issues_count":5,"forks_count":254,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-04-07T04:08:19.493Z","etag":null,"topics":["ansible","install","language","node","nodejs","nodesource","role","setup"],"latest_commit_sha":null,"homepage":"https://galaxy.ansible.com/geerlingguy/nodejs/","language":"Jinja","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/geerlingguy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"geerlingguy","patreon":"geerlingguy"}},"created_at":"2014-03-06T03:02:52.000Z","updated_at":"2025-01-31T03:25:29.000Z","dependencies_parsed_at":"2024-01-14T16:11:07.356Z","dependency_job_id":"d281e60b-e1f9-4937-8c10-54c2e3177425","html_url":"https://github.com/geerlingguy/ansible-role-nodejs","commit_stats":null,"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fansible-role-nodejs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fansible-role-nodejs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fansible-role-nodejs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/geerlingguy%2Fansible-role-nodejs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/geerlingguy","download_url":"https://codeload.github.com/geerlingguy/ansible-role-nodejs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248890947,"owners_count":21178534,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansible","install","language","node","nodejs","nodesource","role","setup"],"created_at":"2024-08-02T03:00:54.410Z","updated_at":"2025-04-14T13:49:54.509Z","avatar_url":"https://github.com/geerlingguy.png","language":"Jinja","funding_links":["https://github.com/sponsors/geerlingguy","https://patreon.com/geerlingguy"],"categories":["Jinja","setup","Ansible roles"],"sub_categories":["Languages"],"readme":"# Ansible Role: Node.js\n\n[![CI](https://github.com/geerlingguy/ansible-role-nodejs/actions/workflows/ci.yml/badge.svg)](https://github.com/geerlingguy/ansible-role-nodejs/actions/workflows/ci.yml)\n\nInstalls Node.js on RHEL/CentOS or Debian/Ubuntu.\n\n## Requirements\n\nNone.\n\n## Role Variables\n\nAvailable variables are listed below, along with default values (see `defaults/main.yml`):\n\n```yaml\nnodejs_version: \"16.x\"\n```\n\nThe Node.js version to install. \"14.x\" is the default and works on most supported OSes. Other versions such as \"10.x\", \"14.x\", \"18.x\", etc. should work on the latest versions of Debian/Ubuntu and RHEL/CentOS.\n\n```yaml\nnodejs_install_npm_user: \"{{ ansible_ssh_user }}\"\n```\n\nThe user for whom the npm packages will be installed can be set here, this defaults to `ansible_user`.\n\n```yaml\nnpm_config_prefix: \"/usr/local/lib/npm\"\n```\n\nThe global installation directory. This should be writeable by the `nodejs_install_npm_user`.\n\n```yaml\nnpm_config_unsafe_perm: \"false\"\n```\n\nSet to true to suppress the UID/GID switching when running package scripts. If set explicitly to false, then installing as a non-root user will fail.\n\n```yaml\nnodejs_npm_global_packages: []\n```\n\nA list of npm packages with a `name` and (optional) `version` to be installed globally. For example:\n\n```yaml\nnodejs_npm_global_packages:\n  # Install a specific version of a package.\n  - name: jslint\n    version: 0.9.3\n  # Install the latest stable release of a package.\n  - name: node-sass\n  # This shorthand syntax also works (same as previous example).\n  - node-sass\n  # Remove a package by setting state to 'absent'.\n  - name: node-sass\n    state: absent\n```\n\n```yaml\nnodejs_package_json_path: \"\"\n```\n\nSet a path pointing to a particular `package.json` (e.g. `\"/var/www/app/package.json\"`). This will install all of the defined packages globally using Ansible's `npm` module.\n\n```yaml\nnodejs_generate_etc_profile: \"true\"\n```\n    \nBy default the role will create `/etc/profile.d/npm.sh` with exported variables (`PATH`, `NPM_CONFIG_PREFIX`, `NODE_PATH`). If you prefer to avoid generating that file (e.g. you want to set the variables yourself for a non-global install), set it to \"false\".\n\n## Dependencies\n\nNone.\n\n## Example Playbook\n\n```yaml\n- hosts: utility\n  vars_files:\n    - vars/main.yml\n  roles:\n    - geerlingguy.nodejs\n```\n\n*Inside `vars/main.yml`*:\n\n```yaml\nnodejs_npm_global_packages:\n  - name: jslint\n  - name: node-sass\n```\n\n## License\n\nMIT / BSD\n\n## Author Information\n\nThis role was created in 2014 by [Jeff Geerling](https://www.jeffgeerling.com/), author of [Ansible for DevOps](https://www.ansiblefordevops.com/).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2Fansible-role-nodejs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgeerlingguy%2Fansible-role-nodejs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgeerlingguy%2Fansible-role-nodejs/lists"}