Skip to content
This repository was archived by the owner on Dec 2, 2020. It is now read-only.

Commit e6ca516

Browse files
committed
Fix for file ownership issues
`user` is an option that gets ignored by puppet. `uid` is meant to be used in order to set a user to execute the command. The effect of using `user` vs `uid` are shown below: ``` ▶ ls -l `npm config get prefix`/lib/node_modules total 0 drwxr-xr-x 12 hugobastien staff 408 14 Nov 22:37 gulp-cli drwxr-xr-x 25 hugobastien staff 850 11 Nov 13:18 npm drwxr-xr-x 6 nobody staff 204 14 Nov 22:09 react-native-cli ``` gulp-cli was installed with the fix that I'm submitting here while react-native-cli was installed current version of puppet-nodejs
1 parent 056271e commit e6ca516

File tree

1 file changed

+2
-2
lines changed
  • lib/puppet/provider/npm_module

1 file changed

+2
-2
lines changed

lib/puppet/provider/npm_module/npm.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ def npm(command, node_version, failonfail = true)
146146
bindir = "/opt/nodes/#{node_version}/bin"
147147
execute "#{bindir}/npm #{command} --global", {
148148
:combine => true,
149-
:user => user,
149+
:uid => user,
150150
#Npm versions greater than 0.10.26 return 1 when no dependencies are returned
151151
:failonfail => failonfail,
152152
:override_locale => false,
@@ -163,7 +163,7 @@ def self.npmlist(node_version)
163163
bindir = "/opt/nodes/#{node_version}/bin"
164164
execute "#{bindir}/npm list --global --json --depth=0 --silent", {
165165
:combine => true,
166-
:user => user,
166+
:uid => user,
167167
#Npm versions greater than 0.10.26 return 1 when no dependencies are returned
168168
:failonfail => false,
169169
:override_locale => false,

0 commit comments

Comments
 (0)