Skip to content

Cannot import npm package "events" with --node-modules-dir=manual #30607

@dsherret

Description

@dsherret

package.json:

{
  "dependencies": {
    "events": "^3.3.0"
  }
}

main.mts:

import * as events from "events";
console.log(events);
$ deno main.mts
error: Relative import path "events" not prefixed with / or ./ or ../
  hint: If you want to use a built-in Node module, add a "node:" prefix (ex. "node:events").
    at file:///home/david/dev/scratch/main.mts:1:25

Works fine with auto or global. This is probably due to conflicting with the node:events built-in module.

Version: Deno 2.4.5

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions