美文网首页
使用TypeScript编写Node

使用TypeScript编写Node

作者: Homary | 来源:发表于2018-12-27 14:58 被阅读0次

tsconfig.json (tsc指定了输入文件时,tsconfig.json无效)

{
    "include": ["./*.ts"],
    "compilerOptions": {
        "allowSyntheticDefaultImports": true,
        "experimentalDecorators": true,
        "allowJs": true,
        "module": "commonjs",
        "target": "es5",
        "moduleResolution": "node",
        "lib": ["es2015"],
        "sourceMap": true,
        "pretty": true,
        "strictFunctionTypes": false,
        "importHelpers": true
    }
}

使用TypeScript编写node,引进http,fs这些node模块提示找不到

npm install @types/node -D

相关文章

网友评论

      本文标题:使用TypeScript编写Node

      本文链接:https://www.haomeiwen.com/subject/ncirlqtx.html