Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Have to use sudo with npm -g #12

Open
pajtai opened this issue May 27, 2015 · 0 comments
Open

Have to use sudo with npm -g #12

pajtai opened this issue May 27, 2015 · 0 comments

Comments

@pajtai
Copy link

pajtai commented May 27, 2015

This causes issues with some npms, e.g. bower.

To get around it I added the following to the task:

- name: Set place for global npms
  shell: npm config set prefix '/home/{{ node_user }}/.npm-packages'
  sudo: no

- name: Add it to your paths
  shell: echo 'export PATH="$PATH:$HOME/.npm-packages/bin"' >> /home/{{ node_user }}/.zshrc

I didn't do a pull request because I wasn't sure how to inorporate the node_user and .zshrc vs .bashrc etc.... but the above fixes the issue and lets you use npm -g without sudo for node_user

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant