Skip to content

Typeroots not inferred with TS2.1+ on Windows #283

Description

@filipesilva

I have a simple repo at https://github.com/filipesilva/tsnode-typeroots that shows this issue.

To reproduce, do:

git clone https://github.com/filipesilva/tsnode-typeroots
cd tsnode-typeroots
npm install
npm run tsc
npm run tsnode

On a OSX machine, both npm scripts will complete successfully. On a Windows machine, npm run tsnode will fail compilation with the following error:

TSError: ⨯ Unable to compile TypeScript
Cannot find type definition file for 'node'. (2688)
index.ts (1,13): Cannot find name 'module'. (2304)

This can be fixed either by:

  • installing typescript@2.0
  • adding "typeRoots": [ "node_modules/@types" ] to compilerOptions in tsconfig.json

I believe this is a bug because the tsc compilation itself completes successfully, whereas the tsnode one does not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions