我正在Windows环境上工作,并试图运行一个分叉的node.js +打字稿项目。
这是我的package.json
:
{
"name": "my-task",
"version": "1.0.0",
"private": true,
"main": "dist/main.js",
"scripts": {
"start": "tsc-watch --onSuccess 'node -r source-map-support/register .'",
"test": "jest",
"lint": "eslint --cache '{src,test}/**/*.ts'"
},
"dependencies": {
"@types/express": "^4.17.7",
"@types/node": "^12.12.53",
"express": "^4.17.1",
"get-port": "^5.1.1",
"got": "^11.5.1",
"source-map-support": "^0.5.19"
},
"devDependencies": {
"@types/jest": "^26.0.8",
"@typescript-eslint/eslint-plugin": "^3.8.0",
"@typescript-eslint/parser": "^3.8.0",
"eslint": "^7.6.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-jest": "^23.20.0",
"jest": "^26.2.2",
"prettier": "^2.0.5",
"ts-jest": "^26.1.4",
"tsc-watch": "^4.2.9",
"typescript": "^4.0.2"
}
}
由于某种原因,我遇到以下错误:
error TS5023: Unknown compiler option '-r'.
我试图删除-r,但是随后出现这些错误:
error TS6054: File '.'' has an unsupported extension. The only supported extensions are '.ts', '.tsx', '.d.ts'.
error TS6231: Could not resolve the path 'source-map-support/register' with the extensions: '.ts', '.tsx', '.d.ts'.
,服务器将无法启动。
我运行了npm uninstall
+ npm install
-似乎没有什么可以解决这些问题。
谁能帮忙?
已编辑:
ts.config:
{
"extends": "../tsconfig.json",
"include": ["**/*.ts"]
}