Skip to content

module path installs puzzling global path #1946

@Trott

Description

@Trott

For the sake of brevity, I'm going to assume Unix-like OS with iojs/node executables installed in /usr/local/bin but this issue is for every/any OS and any sane installation path.

The global path for modules includes /usr/local/lib/node (again, assuming the situation in the first paragraph). That just seems wrong. I can't tell if the correct thing is to include /usr/local/lib/node_modules instead or if the above path should just be removed. (Or maybe I'm misguided and there's a reason it's /usr/local/lib/node and should stay that way. But it sure looks like a bug...)

I'm inclined to remove the path unless there's a good reason to keep it. Adding /usr/local/lib/node_modules might be cool/expected, but that would arguably be a pretty big behavior change (suddenly, require() starts finding all your globally installed modules, which exposes the user to the possibility of dependency hell) that would probably warrant a lot of discussion. On the other hand, removing a useless path seems much lower stakes.

Am I right that it's a bug? Or is there some magic I don't know about?

Metadata

Metadata

Assignees

No one assigned

    Labels

    moduleIssues and PRs related to the module subsystem.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions