我正在尝试使用 Typescript 在 NodeJs 中编写服务器。我已经安装了这些devDependencies:
"@types/config": "^0.0.38",
"@types/express": "^4.17.12",
"@types/jsonwebtoken": "^8.5.1",
"@types/lodash": "^4.14.170",
"@types/morgan": "^1.9.2",
"nodemon": "^2.0.7",
"tslint": "^6.1.3",
"typescript": "^4.3.2"
Run Code Online (Sandbox Code Playgroud)
我的tsconfig.json是这样的:
{
"compilerOptions": {
/* Visit https://aka.ms/tsconfig.json to read more about this file */
/* Basic Options */
// "incremental": true, /* Enable incremental compilation */
"target": "es5", /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019', 'ES2020', 'ES2021', or 'ESNEXT'. */
"module": "commonjs", /* Specify module code generation: 'none', 'commonjs', …Run Code Online (Sandbox Code Playgroud)