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

Can't pass --experimental-specifier-resolution flag to node #1180

Closed
kshetline opened this issue Dec 20, 2020 · 3 comments
Closed

Can't pass --experimental-specifier-resolution flag to node #1180

kshetline opened this issue Dec 20, 2020 · 3 comments

Comments

@kshetline
Copy link

Expected Behavior

Should be able to pass flag.

Actual Behavior

Getting the error message: "Unknown or unexpected option: --experimental-specifier-resolution"

Steps to reproduce the problem

Assume 'ts-node' is installed in the local npm package:
npx ts-node --experimental-specifier-resolution=node example.ts

Minimal reproduction

Same as above.

Specifications

  • ts-node v9.1.1
  • node v14.15.3
  • compiler v4.1.3
  • tsconfig.json:
{
  "compileOnSave": false,
  "compilerOptions": {
    "allowSyntheticDefaultImports": true,
    "outDir": "./dist",
    "sourceMap": true,
    "declaration": true,
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "esModuleInterop": true,
    "experimentalDecorators": true,
    "target": "ES2015",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ]
  },
  "include": ["./src/**/*"],
  "exclude": [
    "**/*.spec.ts",
    "dist",
    "node_modules"
  ]
}

  • Operating system and version: MacOS 11.0.1
@cspotcode
Copy link
Collaborator

This comes up a lot. It's working as intended. See explanation here:
#1073 (comment)

See also, a few others I found in the issue tracker:
#574
#522

This issue explains one of the problems that would happen if we spawned subprocesses.
#471

@cspotcode
Copy link
Collaborator

Closing as answered. If you have more questions, feel free to open a Discussion thread or ask on the TypeScript Community Discord

@cspotcode
Copy link
Collaborator

I've started a discussion post to explain this in more detail.

#1182 Feel free to ask follow-up questions and I'll do my best to update the post with all relevant information.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants