Skip to content
This repository has been archived by the owner on Jan 15, 2024. It is now read-only.

set home variable on npm command #51

Merged
merged 1 commit into from
Jun 25, 2014
Merged

set home variable on npm command #51

merged 1 commit into from
Jun 25, 2014

Conversation

janschumann
Copy link

Fixes #50

Borrowed from voxpupuli/puppet-nodejs#59

if Puppet::Util::Package.versioncmp(Puppet.version, '3.0') >= 0
has_command(:npm, '/usr/local/node/node-default/bin/npm') do
is_optional
environment :HOME => "/root"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why hardcoding this directory BTW? I mean, is it always true that this directory is the home dir?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried to remove

commands :npm => '/usr/local/node/node-default/bin/npm'

and use

has_command(:npm, 'npm') 

but that raised an error … npm command not found.

Hm.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, I was talking about the /root dir. The other one is correct, and the error you got is not unexpected.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Yepp. No this is not always the home dir. I have only tested this for global package installations( npm install -g), where the home dir is required but not really used, I guess?

willdurand added a commit that referenced this pull request Jun 25, 2014
…-on-node-gyp

set home variable on npm command
@willdurand willdurand merged commit ed76bdc into willdurand:master Jun 25, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error on node-gyp rebuild while installing packages with npm
2 participants