Skip to content

Cannot find module when installed globally #3865

@unional

Description

@unional

Some modules cannot be found when installed globally.

Say I have:

C:\Users\me\AppData\Roaming\npm
├── casperjs@1.1.0-beta3
├── gulp@3.9.0
├── jspm@0.16.14
├── jspm-p4@0.2.3
├── karma@0.13.15
├── npm@3.4.0
├── npm-check-updates@2.4.2
├── phantomjs@1.9.18
└── tsd@0.6.5

When I am at a folder that does not have local modules (e.g. C:\Users\me):

C:\Users\me> node
> require('jspm')
-> jspm;
> require('karma');
-> karma;
> require('jspm-p4');
-> Cannot find module (Error)
> require('npm-check-updates')
-> Cannot find module (Error)

Adding NODE_PATH explicitly pointing to C:\Users\me\AppData\Roaming\npm\npm_modules solves the problem, but that would consider as a workaround instead of a solution as some modules are working while others not.

Referencing original issue:
jspm/jspm#1284

jspm-p4 is a module that I created and you can find it here

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