Skip to content

Cannot find module '/TypeScript/lib/tsc' - TypeScript Project #56581

@PUNAMRAMPUKALE

Description

@PUNAMRAMPUKALE

⚙ Compilation target

es2018

⚙ Library

typescript

Missing / Incorrect Definition

-Issue Description
When attempting to start the TypeScript project using Node.js v20.9.0, the following error is
encountered

-Steps to Reproduce
Install Node.js v20.9.0.
Navigate to the TypeScript project directory.
Run the command : npm run build and npm start.

-Expected Behavior
The TypeScript project should start without any errors using Node.js v20.9.0.

-Actual Behavior
The mentioned error is thrown, indicating a module not found issue for '/TypeScript/lib/tsc'.

-Environment
Node.js version: 20.9.0
TypeScript version: 5.4.0

Sample Code

typescript@5.4.0 start
node lib/tsc

node:internal/modules/cjs/loader:1051
  throw err;
  ^

Error: Cannot find module '/Users/punam/Documents/TypeScript/lib/tsc'
    at Module._resolveFilename (node:internal/modules/cjs/loader:1048:15)
    at Module._load (node:internal/modules/cjs/loader:901:27)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12)
    at node:internal/main/run_main_module:23:47 {
  code: 'MODULE_NOT_FOUND',
  requireStack: []
}

Node.js v20.9.0

Documentation Link

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    InfrastructureIssue relates to TypeScript team infrastructure

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions