Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

New option for Windows required: system-wide install #4534

Closed
litmit opened this issue Jan 23, 2014 · 2 comments
Closed

New option for Windows required: system-wide install #4534

litmit opened this issue Jan 23, 2014 · 2 comments

Comments

@litmit
Copy link

litmit commented Jan 23, 2014

Based on issues:

I think npm should have clear way for manage system-wide packages (packages available for all users in system on Windows)

Therefore npm should deal with three types of packages:

  • local (without option)

  • global for user (--global)

    this type of installation is very useful for development and testing purposes

  • global for system (--system for example)

    this type of installation needed in production environment

The system-wide installation should:

  1. uses other path for packages (accessible for reading by all users in system).
  2. uses system environment variable PATH to store path to executables.

The system-wide installation may require the administrator's rights for user that invoke npm --system

There are possible variants for path for system-wide installation (discussion need):

  1. %PROGRAMDATA%/npm (absent in Windows XP)
  2. %PROGRAMFILES%/npm
  3. Node's folder

Node's javascript afaik has no ability to set system environment variable %PATH%, but this variable can be set as part of Node installation (therefore Node's folder seems already ready for such installation).

@othiym23
Copy link
Contributor

othiym23 commented Oct 7, 2014

It turns out we were just discussing this over on #6413, and have been discussing closely related issues on #4564. I think this would be a good idea – maybe – but it's also pretty far down the priority queue because it's a pretty dramatic change and thus at least a major version out. I'm not averse to looking at patches or discussing it further, though.

@othiym23
Copy link
Contributor

After discussing this further with @iarna and @zkat, we agree that adding a third kind of prefix to npm, or making Windows and Unix-like OSes behave the same way here, is probably more complexity than is justified by the use cases created by this request. If you're installing binaries on a Windows system and want them shared across all tenants on the host, using npm config set prefix <global path> and running npm install --global <package> as Administrator will get most people where they need to go. (The need to run as Administrator is part of the reason why the original default for "global" installs was set to a path known to be controlled by the local user – it's awkward to support, and the team doesn't like advising users to run with elevated privileges unnecessarily.)

Because the team isn't going to get to this within the next year, I'm going to close this issue. Keep an eye on #4564, though – sometime in the not-too-distant future we're going to come to a resolution about the best place to put user-wide "global" installs on Windows, that may go some ways to addressing your need here. Thanks for your time!

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

2 participants