You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
npm broken under windows (v2.2.1 and v2.2.2 nightly) #1940
When I install a global module, it gets installed in HOME/AppData/Roaming/npm/node_modules but this path is not searched in Module.require (see below).
Shouldn't global modules be installed in Program Files/lib/node ?
This is absolutely normal behavior. AFAIR, global modules have always been installed into %AppData%\npm on WIndows and never been accessible from scripts.
The point is to be able to install, for instance, system-wide command-line applications like PM2 or Bower.
And I'm afraid to disappoint you but such behavior is identical on all platforms. Global modules are not accessible in scripts neither on Windows nor on Mac OS.
I'm seeing this same behavior on OS X. I am seeing it on Node v0.10.36 as well as io.js, so I don't think it's a bug.
But that last path under globalPaths sure is curious and one could be forgiven for thinking something is amiss. In that regard, I'm seeing the same thing as @lucidogen and that path does not exist. But even more curious, if I change the last component of that path from node to node_modules, that path does exist and it is where my global modules are installed.
I haven't bothered (yet, at least) looking in to how and why that last path gets set, but one can certainly be forgiven for thinking it's a probable bug.
Activity
v12 commentedon Jun 10, 2015
This is absolutely normal behavior. AFAIR, global modules have always been installed into
%AppData%\npmon WIndows and never been accessible from scripts.v12 commentedon Jun 10, 2015
The point is to be able to install, for instance, system-wide command-line applications like PM2 or Bower.
And I'm afraid to disappoint you but such behavior is identical on all platforms. Global modules are not accessible in scripts neither on Windows nor on Mac OS.
Trott commentedon Jun 11, 2015
I'm seeing this same behavior on OS X. I am seeing it on Node v0.10.36 as well as io.js, so I don't think it's a bug.
But that last path under
globalPathssure is curious and one could be forgiven for thinking something is amiss. In that regard, I'm seeing the same thing as @lucidogen and that path does not exist. But even more curious, if I change the last component of that path fromnodetonode_modules, that path does exist and it is where my global modules are installed.I haven't bothered (yet, at least) looking in to how and why that last path gets set, but one can certainly be forgiven for thinking it's a probable bug.
Trott commentedon Jun 11, 2015
Looking at the code, I do think this is actually a bug. I'll open a separate ticket.
Trott commentedon Jun 11, 2015
Opened #1946