Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

The npm global flag seems to be inconsistent on Windows #3155

Closed
MiguelMadero opened this Issue · 4 comments

6 participants

@MiguelMadero

I posted a question on SO, but I wanted to repost here since this might be an issue and not so much a question.

@coiscir

The inconsistency referenced is with the global npm.root/npm.dir between the bundled install with Node.js and other installs of npm.

Example on 32-bit Win 7:

> npm root -g
C:\Users\...\AppData\Roaming\npm\node_modules

> npm install npm
...
npm@1.2.10 node_modules\npm

> .\node_modules\.bin\npm root -g
C:\Program Files\nodejs\node_modules

It seems to be from a builtin npmrc that only sets prefix=${APPDATA}\npm for the bundled install.

@RoystonS

Here's the issue that resulted in the Windows-bundled npmrc shipping with the APPDATA prefix: joyent/node#2207

It's certainly a PITA that installing a new version of npm changes the global root prefix, as it then starts to require administrator privilege to install new global modules. I'd be surprised if that's by design.

@smikes

This looks like more than just a support issue, but I am not sure whether it's better to call it a bug or feature-request. I know we have recently run into APPDATA-related issues with current (0.10.36) node and npm packaging.

If you had complete discretion to set these values up most usefully for the "standard Windows node user" -- i.e., someone who is using Visual Studio, cmd, and msysgit -- how would these variables be set, and what would be the permissions on these directories?

/cc @othiym23 in case you have anything to add?

@othiym23
Owner

This issue was addressed in a8da8d6, and has not been a problem since 2.1.4, so I'm going to go ahead and close this as resolved. At some point, we need to figure out a better way to centrally configure npm on Windows, but all fresh installs of npm should correctly carry this configuration from one install of npm to the next.

@othiym23 othiym23 closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.