简体   繁体   中英

Typescript 2.0 + VS 2015 @types not working

iam using:

Visual Studio 2015 with NodeJs Tools 1.2
TypeScript 2.0 (updated from 1.8)

When i compile typescript with tsc everything works.

But in Visual Studio modules like express are not found.

My tsconfig:

{
  "compilerOptions": {
    "target": "es6",
    "module": "commonjs",
    "moduleResolution": "node",
    "declaration": false,
    "sourceMap": false,
    "noImplicitAny": false,
    "removeComments": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "rootDir": "src/",
    "outDir": "target/"
  },
  "exclude": [
    "node_modules",
    "target"
  ]
}

i installed express typing as

"@types/express": "^4.0.33",

and iam using it like

import * as express from 'express';

but module wasnt found. ONLY IN VISUAL STUDIO

好的,我需要从Microsoft安装适用于Visual Studio的新打字稿工具

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM