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

npm_config_prefix default shouldn't be a relative path #29

Closed
louim opened this issue Jun 8, 2016 · 8 comments
Closed

npm_config_prefix default shouldn't be a relative path #29

louim opened this issue Jun 8, 2016 · 8 comments

Comments

@louim
Copy link

louim commented Jun 8, 2016

Hello!
#28 added a default npm_config_prefix of ~/.npm-global, and this path is added to the global path (for all users). So for all other user except the ansible_ssh_user, this path will not resolve because it will be expanded as their home folder.

I think a better default would be something like: /usr/local/lib/npm, so the path will resolve for all users.

What do you think?
cc @thom8

@thom8
Copy link
Contributor

thom8 commented Jun 9, 2016

@louim yeah I agree that's a saner default for this role.

I was using the context of a VM provisioned with a single non admin user whereas this role can be used elsewhere in a multi user environment.

Just need to override this variable in the default config of Drupal VM to avoid introducing a regression geerlingguy/drupal-vm#629

@sarahjean
Copy link

I was just trying to get something similar working, with the latest version of Drupal VM. Here's the config I was trying to use in the config.yml:

# `nodejs` must be in installed_extras for this to work. Valid examples: "0.10",
# "0.12", "4.x", "5.x".
nodejs_version: "4.x"

nodejs_npm_global_packages: 
  - name: gulp
  - name: browser-sync
  - name: avn
  - name: avn-nvm

nodejs_install_npm_user: "vagrant"
npm_config_prefix: "~/.npm-global"
npm_config_unsafe_perm: "true"

I have also tried it without that last variable, and with the alternate option of npm_config_prefix: "/usr/local/lib/npm"

The install for global packages just keeps failing. I will try to attach npm-debug.log as well, if that will be of any use.
npm-debug.log.txt

@louim
Copy link
Author

louim commented Jun 9, 2016

@sarahjean are you sure you are running the latest version of the role? The log make it look like it is trying to write to /usr/lib/node_modules/avn-nvm.

@sarahjean
Copy link

Not the latest, do I need to be on 3.1.0 for this? The latest tagged version of drupal-vm is running this

- src: geerlingguy.nodejs
  version: 3.0.0

@louim
Copy link
Author

louim commented Jun 9, 2016

Yep: 3.0.0...3.1.0

@sarahjean
Copy link

@lulm, Ok, bumped the version and it worked beautifully.

@geerlingguy
Copy link
Owner

Fixed via #31

@geerlingguy
Copy link
Owner

This will be in 3.2.0 (and I'll have Drupal VM use that role version for it's 3.1.1 release).

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

4 participants