Skip to content

require does not work as described in the documentation #18695

@smkoyan

Description

@smkoyan
  • v9.5.0:
  • Windows 10 Pro 64-bit:
  • modules:

I have this file structure:
image

  • app.js
    console.log( require.resolve('./hello') );

  • package.json
    { "main": "test" }

other files are empty.

run: node app.js

if rely on the documentation require should find file underlined in the picture below:
image
hello.js

but it finds this:
image
test.js

It should find file in step 3.a but it finds in step 3.b
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions