Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

nodejs for Windows does not set a npm global package properly #6944

Closed
lmayorga1980 opened this issue Jan 22, 2014 · 4 comments
Closed

nodejs for Windows does not set a npm global package properly #6944

lmayorga1980 opened this issue Jan 22, 2014 · 4 comments

Comments

@lmayorga1980
Copy link

We have puppet to provision some windows environments which also install nodejs for windows. We tried to install certain packages like this...

 exec { 'dependo':
    command   => 'npm.cmd install -g dependo@0.1.1',
    logoutput => true,
    path      => 'C:\Program Files (x86)\nodejs',
    unless    => 'npm.cmd -g ls dependo@0.1.1 | c:\windows\system32\findstr.exe dependo@0.1.1'
  }

  exec { 'plato' :
    command   => 'npm.cmd install -g plato@0.6.2',
    logoutput => true,
    path      => 'C:\Program Files (x86)\nodejs',
    unless    => 'npm.cmd -g ls plato@0.6.2 | c:\windows\system32\findstr.exe plato@0.6.2'
  }

  exec { 'bower' :
    command   => 'npm.cmd install -g bower@1.2.7',
    logoutput => true,
    path      => 'C:\Program Files (x86)\nodejs',
    unless    => 'npm.cmd -g ls bower@1.2.7 | c:\windows\system32\findstr.exe bower@1.2.7'
  }

Since the Puppet Windows Service runs under the SYSTEM account when we try to invoke "lets say bower from the command line logged as a different user" we have errors complaining about command not found.

If we run the same Puppet Windows Service with the same user then everything works fine.

It seems that the packages go to C:\Users\<username>\AppData\Roaming\npm and sets a USER Environment Variable PATH. When executed as the local SYSTEM account i was not able to find the local path of the bower.cmd.

@litmit
Copy link

litmit commented Jan 23, 2014

See also #4360

@wonderdogone
Copy link

This has been a problem for awhile. I install everything local to run applications . This is bad when middle tier IT is handed the projects and can't install things correctly. Many enterprise run on windows servers (yuck I know), but they do. If the IT folks complain it gives upper management the excuse to not use node even if our development team want to and know why we should.

@lmayorga1980
Copy link
Author

Any news about this issue?

@othiym23
Copy link

I believe this is related to #8141.

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

No branches or pull requests

6 participants