Skip to content

typeRoots not supported #153

Closed
Closed

Description

@filipesilva

Heya, I'm using ts-node with protractor to run some TS tests and wanted to try out the new @types/* repos for typings.

My tsconfig.json has "typeRoots": [ "../node_modules/@types" ] and that seems to work with the local project tsc, but not with ts-node.

Does ts-node at the moment support typeRoots?

Activity

  1. blakeembrey commented on Jul 21, 2016

    @blakeembrey
    Member

    TypeScript 2.0 is still in beta, so it's hard to know. I believe support was probably added with 240d4b9 but if you can confirm that would help.

  2. added
    question
    on Jul 21, 2016
  3. filipesilva commented on Jul 22, 2016

    @filipesilva
    Author

    @blakeembrey just tested and it does work, cheers!

  4. cristianmtr commented on Jan 20, 2017

    @cristianmtr

    This doesn't work for me.

    Unknown compiler option 'typeroots'. (5023)
        at load (C:\Users\cristianmitroi\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:199:13)
        at service (C:\Users\cristianmitroi\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:363:32)
        at Object.register (C:\Users\cristianmitroi\AppData\Roaming\npm\node_modules\ts-node\src\index.ts:372:5)
        at Object.<anonymous> (C:\Users\cristianmitroi\AppData\Roaming\npm\node_modules\ts-node\src\_bin.ts:148:17)
        at Module._compile (module.js:541:32)
        at Object.Module._extensions..js (module.js:550:10)
        at Module.load (module.js:458:32)
        at tryModuleLoad (module.js:417:12)
        at Function.Module._load (module.js:409:3)
        at Function.Module.runMain (module.js:575:10)
    
    • Windows 7, x64
    ts-node --version
    ts-node v2.0.0
    node v6.2.0
    
    • tsconfig:
    {
        "compilerOptions": {
            "module": "commonjs",
            "target": "es5",
            "noImplicitAny": false,
            "sourceMap": false,
            "types": [
                // add node as an option
                "node"
            ],
            // typeroots option has been previously configured
            "typeroots": [
                // add path to @types
                "../node_modules/@types"
            ]
        }
    }
    
  5. blakeembrey commented on Jan 20, 2017

    @blakeembrey
    Member

    Try with a capital R. When in doubt, please try tsc directly to confirm if it should work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    question

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions