打字稿找不到模块

时间:2016-07-17 13:19:34

标签: typescript node-modules typescript1.8 tsc tsconfig

我的服务器.ts文件抱怨找不到模块和打字,但我安装了模块并检查了node_modules

这是我的项目结构:screenshot

我得到的错误:screenshot

tsconfig.json

{
    "compilerOptions": {
        "module": "commonjs",
        "moduleResolution": "node",
        "target": "es5",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "noImplicitAny": false
    },
    "exclude": [
        "node_modules",
    "typings"
    ],
    "filesGlob": [
    "**/*.ts",
    "typings/main",
    "./typings/index.d.ts"
    ]
}

1 个答案:

答案 0 :(得分:0)

原生打字稿(github

尚不支持

filesGlob

我的建议是删除filesGlob部分,因为它看起来你实际上并不需要它,而是:

{ 
    "compilerOptions": {
        "module": "commonjs",
        "moduleResolution": "node",
        "target": "es5",
        "sourceMap": true,
        "emitDecoratorMetadata": true,
        "experimentalDecorators": true,
        "noImplicitAny": false
    },
    "exclude": [
        "node_modules",
        "typings/browser.d.ts",
        "typings/browser/**"
    ]
} 

希望这有帮助。