Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot start file without extension with --experimental-specifier-resolution=node #38933

Closed
tsapko3628 opened this issue Jun 4, 2021 · 2 comments
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.

Comments

@tsapko3628
Copy link

tsapko3628 commented Jun 4, 2021

  • Version: 14.17.0, 16.2.0, 16.3.0
  • Platform: maxOS Big Sur 11.14.0
  • Subsystem:

What steps will reproduce the bug?

Install typescript and run npx tsc with NODE_OPTIONS="--experimental-specifier-resolution=node"

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior?

Run typescript compiler correctly

What do you see instead?

internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

TypeError [ERR_INVALID_MODULE_SPECIFIER]: Invalid module "file:///path/to/project/node_modules/typescript/bin/tsc" 
    at Loader.getFormat (internal/modules/esm/loader.js:117:13)
    at async Loader.getModuleJob (internal/modules/esm/loader.js:242:20)
    at async Loader.import (internal/modules/esm/loader.js:176:17)
    at async Object.loadESM (internal/process/esm_loader.js:68:5) {
  code: 'ERR_INVALID_MODULE_SPECIFIER'
}

Additional information

microsoft/TypeScript#44342

@tsapko3628 tsapko3628 changed the title --experimental-specifier-resolution=node Cannot start file without extension Cannot start file without extension with --experimental-specifier-resolution=node Jun 4, 2021
@aduh95
Copy link
Contributor

aduh95 commented Jun 4, 2021

That looks like a npm issue, not a Node.js one. You should open an issue on their repo (https://github.com/npm/cli), they probably want to fix that indeed.

@aduh95 aduh95 closed this as completed Jun 4, 2021
@aduh95 aduh95 added the wrong repo Issues that should be opened in another repository. label Jun 4, 2021
@aduh95
Copy link
Contributor

aduh95 commented Jun 4, 2021

Reading through the linked issue, it looks like your issue is not related to npx exactly, it's really the extensionless part that is at stake here, sorry I read the OP too fast. In this case, I think your issue is a duplicate of #35518.

If I've missed something, feel free to give more details and to reopen this issue :)

@aduh95 aduh95 added duplicate Issues and PRs that are duplicates of other issues or PRs. and removed wrong repo Issues that should be opened in another repository. labels Jun 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate Issues and PRs that are duplicates of other issues or PRs.
Projects
None yet
Development

No branches or pull requests

2 participants