cost 74 ms
错误表达式:非字符串值传递给 typescript 中的“ts.resolveTypeReferenceDirective” - False expression: Non-string value passed to `ts.resolveTypeReferenceDirective` in typescript

当我尝试运行 ts-node-dev./index.ts 时,出现以下错误,我更新了我的 typescript 和 ts-node-dev, ts-node 但如果我删除具有 @types 的依赖项,此错误会继续弹出/XXXX(eg:@types/express) 它工作正常。 错误表达式:传递给 ...

如何在 nodejs 中导入文件以适应 tsc build & ts-node-dev? - How to import files in nodejs in order to fit tsc build & ts-node-dev?

当我使用 ts-node-dev 时,导入的文件必须命名为“./api”或“./api.ts”,并且在构建项目时(使用 tsc),我需要“./api.js” (这是正常的......它变成了纯js)。 有没有办法让 ts 明白 .js 在 dev 中导入 mean.ts 并避免在构建后手动重命名? ...

在使用 ts-node-dev 的导入语句附近出现错误“SyntaxError: Unexpected string” - getting an error "SyntaxError: Unexpected string" near the import statement working with ts-node-dev

我试图将 typescript 库与节点一起使用,但我不断收到这些语法错误。 我正在使用 ts-node-dev 从 package.json 运行开发脚本。 错误显示在导入语句附近,我不确定它是否是我的 tsconfig.json 的问题(它也附在下面)。 但我正在使用“模块”:“commonj ...

输入'文章| null' 不可分配给类型 'void' - Type 'Article | null' is not assignable to type 'void'

我正在尝试使用打字稿将接口实现到类中。 这是我的课: 然后我的界面: 对于我想要实现的任何其他存储库,我需要遵循该接口。 顺便说一下,编辑器在 find 方法中显示了这个错误: “ArticleMySQLRepository”类型中的属性“find”不能分配给基本类型“Articl ...

ts-node-dev 遇到错误:“找不到模块'typescript'” - ts-node-dev runs into an error: "Cannot find module 'typescript'"

我正在尝试设置一个基本的 nest.js 应用程序。 main.js 位于 src 文件夹中。 我运行这个命令: 我收到此错误: 我全局安装了打字稿,关闭终端并重新启动它。 运行tsc -v我得到“版本 4.3.5”,但错误没有解决。 这是 tsconfig.json: 安装tsc ...

在从 typescript 编译的代码中导入 PrismaClient 时出错 [SyntaxError: Named export 'PrismaClient' not found] - Error importing PrismaClient in code compiled from typescript [SyntaxError: Named export 'PrismaClient' not found]

在 server.ts 中,像这样导入 PrismaClient: 使用 tsc 构建并运行编译后的代码时抛出错误: 所以我做了推荐的事情并将代码更改为: 此代码在使用 tsc 构建并运行生成的代码后工作。 但是现在使用 ts-node-dev 运行 typescript 文件会引发此错误: 并将 ...

无法从 TypeScript 反射系统推断 GraphQL 类型。 您需要为“地址”class 的“id”提供显式类型 - Unable to infer GraphQL type from TypeScript reflection system. You need to provide explicit type for 'id' of 'Address' class

信息:ts-node-dev 版本。 1.0.0(使用 ts-node 版本 9.1.1,typescript 版本 4.0.5) 使用此命令ts-node-dev --respawn server.shop.ts开始应用程序时,出现以下错误。 (无法从 TypeScript 反射系统推断 G ...

为 VS Code / ts-node / ts-node-dev 指定备用 tsconfig.json - Specify alternate tsconfig.json for VS Code / ts-node / ts-node-dev

我正在将我的项目从 JavaScript 迁移到 Typescript。 我希望使用默认的tsconfig.json在 VS Code 中显示更严格的警告,但有一个备用的tsconfig.json具有更宽松的tsc编译器选项以允许成功构建。 迁移计划是随着时间的推移逐渐strict化备用的,ju ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM