Skip to content

require fails to load 'package.json' when the module path contains Chinese characters on Windows. #2236

Closed
@hokein

Description

@hokein

Reproduce steps:

  • Create a Chinese-name node module directory that contains a package.json, like
 中文目录
  |-- main.js
  |-- package.json

And the content of package.json:

{
  "name": "test",
  "productName": "test",
  "main": "main.js"
}
  • Type require("<Chinese-path>") in iojs, then Error Error: Cannot find module XXX will arise.

It fails on iojs v2.4 and v3.0 rc4, but works on v1.6, I believe a regression issue. What's more, it seems only fails to read the package.json file. If we require a absolute js path(<Chinese-path>/main.js), it loads the module well.

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmed-bugIssues with confirmed bugs.i18n-apiIssues and PRs related to the i18n implementation.moduleIssues and PRs related to the module subsystem.windowsIssues and PRs related to the Windows platform.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions