Skip to content

-r/--require flag for npm modulesΒ #1803

@wavded

Description

@wavded

Given the following steps:

npm install heapdump
node -r heapdump file.js

I get the following error:

Error: Cannot find module 'heapdump'
    at Function.Module._resolveFilename (module.js:337:15)
    at Function.Module._load (module.js:287:25)
    at node.js:858:16
    at Array.forEach (native)
    at Function.startup.preloadModules (node.js:857:32)
    at startup (node.js:95:17)
    at node.js:963:3

My expectation was the module would be resolved the same way as if I were to do:

require('heapdump')

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.moduleIssues and PRs related to the module subsystem.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions