【发布时间】:2020-07-14 01:33:29
【问题描述】:
我正在尝试运行apollo-server,而我编写的代码位于TypeScript。
我的代码文件夹包含一个tsconfig.json,如下所示:
{
"compilerOptions": {
"target": "esnext",
"lib": [
"esnext"
],
"allowJs": true,
"skipLibCheck": true,
"esModuleInterop": true,
"allowSyntheticDefaultImports": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true
},
"include": [
"server"
]
}
我正在运行的命令如下:
$ npx ts-node ./server/index.ts
如果我删除 tsconfig.json(我当然不能这样做),上面的命令可以正常工作。我不确定实际上是哪个配置导致了问题。
【问题讨论】:
-
您找到解决方案了吗?
-
@Pablo 现在我暂时删除了似乎有效的模块选项。
标签: node.js typescript compilation tsconfig ts-node