简体   繁体   English

Typescript 2.0 + VS 2015 @types不起作用

[英]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. 当我用tsc编译打字稿时,一切正常。

But in Visual Studio modules like express are not found. 但是在Visual Studio中找不到Express这样的模块。

My tsconfig: 我的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的新打字稿工具

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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