{"action":"created","issue":{"url":"https://api.github.com/repos/geerlingguy/ansible-role-nodejs/issues/40","repository_url":"https://api.github.com/repos/geerlingguy/ansible-role-nodejs","labels_url":"https://api.github.com/repos/geerlingguy/ansible-role-nodejs/issues/40/labels{/name}","comments_url":"https://api.github.com/repos/geerlingguy/ansible-role-nodejs/issues/40/comments","events_url":"https://api.github.com/repos/geerlingguy/ansible-role-nodejs/issues/40/events","html_url":"https://github.com/geerlingguy/ansible-role-nodejs/issues/40","id":169794510,"number":40,"title":"npm ls -g doesn't list globally installed packages when NPM_CONFIG_PREFIX is set","user":{"login":"x-yuri","id":730588,"avatar_url":"https://avatars.githubusercontent.com/u/730588?v=3","gravatar_id":"","url":"https://api.github.com/users/x-yuri","html_url":"https://github.com/x-yuri","followers_url":"https://api.github.com/users/x-yuri/followers","following_url":"https://api.github.com/users/x-yuri/following{/other_user}","gists_url":"https://api.github.com/users/x-yuri/gists{/gist_id}","starred_url":"https://api.github.com/users/x-yuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x-yuri/subscriptions","organizations_url":"https://api.github.com/users/x-yuri/orgs","repos_url":"https://api.github.com/users/x-yuri/repos","events_url":"https://api.github.com/users/x-yuri/events{/privacy}","received_events_url":"https://api.github.com/users/x-yuri/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-07T12:39:44Z","updated_at":"2016-08-08T10:49:50Z","closed_at":null,"body":"`playbook.yml`:\r\n```\r\n- hosts: all\r\n  become: yes\r\n\r\n  roles:\r\n    - role: geerlingguy.nodejs\r\n      nodejs_version: 4.x\r\n\r\n  tasks:\r\n    - name: Install node packages\r\n      npm: name={{ item }} global=yes\r\n      with_items: [bower, gulp-cli]\r\n```\r\n\r\n```\r\n# set | grep NPM\r\nNPM_CONFIG_PREFIX=/usr/local/lib/npm\r\n# npm ls -g\r\n\r\n\r\n# unset NPM_CONFIG_PREFIX\r\n# npm ls -g --depth=0\r\n/usr/lib\r\n├── bower@1.7.9\r\n├── gulp-cli@1.2.2\r\n└── npm@2.15.8\r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/geerlingguy/ansible-role-nodejs/issues/comments/238202892","html_url":"https://github.com/geerlingguy/ansible-role-nodejs/issues/40#issuecomment-238202892","issue_url":"https://api.github.com/repos/geerlingguy/ansible-role-nodejs/issues/40","id":238202892,"user":{"login":"x-yuri","id":730588,"avatar_url":"https://avatars.githubusercontent.com/u/730588?v=3","gravatar_id":"","url":"https://api.github.com/users/x-yuri","html_url":"https://github.com/x-yuri","followers_url":"https://api.github.com/users/x-yuri/followers","following_url":"https://api.github.com/users/x-yuri/following{/other_user}","gists_url":"https://api.github.com/users/x-yuri/gists{/gist_id}","starred_url":"https://api.github.com/users/x-yuri/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/x-yuri/subscriptions","organizations_url":"https://api.github.com/users/x-yuri/orgs","repos_url":"https://api.github.com/users/x-yuri/repos","events_url":"https://api.github.com/users/x-yuri/events{/privacy}","received_events_url":"https://api.github.com/users/x-yuri/received_events","type":"User","site_admin":false},"created_at":"2016-08-08T10:49:49Z","updated_at":"2016-08-08T10:49:49Z","body":"[From what I can tell][1], it specifies where `npm` installs global packages. And to make it clear, it's not me who [sets][2] it. And actually it looks like a [bug][3] in `ansible`'s `npm` module (not propagating environment variables), but I can't tell for sure.\r\n\r\n[1]: https://docs.npmjs.com/getting-started/fixing-npm-permissions\r\n[2]: https://github.com/geerlingguy/ansible-role-nodejs/blob/master/templates/npm.sh.j2#L2\r\n[3]: https://github.com/geerlingguy/ansible-role-nodejs/blob/master/tasks/main.yml#L47"}}
{"actor":{"display_login":"x-yuri"}}