我面临以下错误:
connect-43d439c034e475bba644.chunk.js:10 Uncaught Error: Module build failed (from ./node_modules/ts-loader/index.js):错误:Debug Failure。False表达式:传递给ts的非字符串值。resolveTypeReferenceDirective’,可能是一个使用过时的resolveTypeReferenceDirectives签名的包装包。这可能不是TS本身的问题。在对象。resolveTypeReferenceDirective (: 3000/node_modules/打印稿/lib/typescript.js: 42537:18): 3000/node_modules/ts-loader/dist/servicesHost.js: 373:77: 3000/node_modules/ts-loader/dist/servicesHost.js: 95:142在数组中。map ()在对象。resolveTypeReferenceDirectives (: 3000/node_modules/ts-loader/dist/servicesHost.js: 95:125)在actualResolveTypeReferenceDirectiveNamesWorker (:3000/node_modules/typescript/lib/typescript.js:116674:163)在resolveTypeReferenceDirectiveNamesWorker (:3000/node_modules/typescript/lib/typescript.js:116974:26)@ processTypeReferenceDirectives (:3000/node_modules/typescript/lib/typescript.js:118456:31)在findSourceFileWorker (:3000/node_modules/typescript/lib/typescript.js:118341:21)在findSourceFile (:3000/node_modules/typescript/lib/typescript.js:118196:26)在/app/javascript/连接/指数。ts (connect-43d439c034e475bba644.chunk.js: 7)__webpack_require__ (bootstrap:79:1)./app/javascript/packs/connect.js (connect.js:7:1)__webpack_require__ (bootstrap:79:1)在1 (log$:23:1)__webpack_require__ (bootstrap:79:1)在checkDeferredModules (bootstrap:45:1)在数组中。webpackJsonpCallback [as push] (bootstrap:32:1)
在这一点上,我已经尝试了几乎所有的方法:
更新ts-node更新打印稿更新ts-loader
然而,似乎没有什么能解决这个问题。
在这一点上,我认为这不是严格意义上的TS,但我不确定。以下是我的软件包版本:
{
"name": "Angular",
"version": "1.0.0",
"main": "index.js",
"repository": "",
"author": "",
"license": "MIT",
"dependencies": {
"@angular-cool/inline-edit-field": "^1.0.3",
"typescript": "^4.2",
"uppy": "0.23.3",
"zone.js": "^0.11.4"
},
"devDependencies": {
"css-minimizer-webpack-plugin": "^3.1.1",
"html-minimizer-webpack-plugin": "^3.3.0",
"terser-webpack-plugin": "^5.2.4",
"webpack-dev-server": "^3.10.3"
},
"resolutions": {
"acorn": "^6.4.1",
"minimist": "^1.2.3",
"kind-of": "^6.0.3"
},
"engines": {
"node": "14.x"
}
}
如果有人能给我一些建议,告诉我现在要找什么,或者什么可能是错的,我会很感激的。提前感谢!
我刚刚找到了解决问题的方法问题是一些依赖关系他们采用了更大的版本,因为他们应该使用'^ X.X.X'
i had set"typescript": "4.3.5",
instead of"typescript": "^4.2",
etc .
给我我可以绕过这个通过运行
npx ts-node ./test.ts
不是
ts-node ./test.ts