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

TypeScript 2.0.3: Can't find @types installation #11193

Closed
arahansen opened this issue Sep 27, 2016 · 1 comment
Closed

TypeScript 2.0.3: Can't find @types installation #11193

arahansen opened this issue Sep 27, 2016 · 1 comment
Labels
Duplicate An existing issue was already created

Comments

@arahansen
Copy link

The compiler doesn't seem to be picking up on my npm installed @types modules. Is there a specific configuration I might be missing?

TypeScript Version: 2.0.3

Code

installed:
npm install @types/angular --save-dev

// tsconfig.json

{
        "compileOnSave": false,
        "compilerOptions": {
            "types": ["angular"],
            "typeRoots": [
        "node_modules/@types"
      ],
            "module": "amd",
            "noImplicitAny": false,
            "preserveConstEnums": true,
            "target": "es5",
            "declaration": false,
            "moduleResolution": "classic",
            "experimentalDecorators": true,
            "suppressImplicitAnyIndexErrors": true,
            "sourceMap": true,
            "jsx": "react"
        },
        "include": [
            "node_modules/@types/**/*",
            "app/**/*.ts",
            "app/**/*.tsx"
        ]
}

run:
node_modules/typescript/bin/tsc -p .

Expected behavior:
Typescript compiler can find @types npm installations and successfully compile.

Actual behavior:
Several errors thrown throughout my source code that reference not finding the angular typings:
error TS2307: Cannot find module 'angular'.

@mhegazy
Copy link
Contributor

mhegazy commented Sep 27, 2016

This is a duplicate of #11103. currently @types are not loaded unless moduleResolution === node.

@mhegazy mhegazy added the Duplicate An existing issue was already created label Sep 27, 2016
@mhegazy mhegazy closed this as completed Sep 27, 2016
@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

2 participants