ts-node运行typescript文件报类型错误:TypeError: Unknown file extension “.ts“

ts-node --version

v10.9.2

根目录添加package.json

还是报错

添加tsconfig.json

json 复制代码
{  "compilerOptions": {    "module": "commonjs",    "target": "es6"  },  "ts-node": {    "compilerOptions": {      "module": "commonjs"    },    "transpileOnly": true,    "files": true  },  "include": [    "**/*.ts"  ]}

参考:blog.csdn.net/panghuangan...

相关推荐
guangzan18 小时前
DeepSeek-Lane:在 Cursor 内使用 DeepSeek V4 模型
typescript
晓杰'1 天前
从0到1实现 Balatro 游戏后端(1):项目规划与牌型判断实现
后端·websocket·typescript·node.js·游戏开发·项目实战·nestjs
Forget the Dream1 天前
基于适配器模式的 Axios 封装实践
设计模式·typescript·axios·适配器模式
烛衔溟2 天前
TypeScript 接口继承与混合类型
linux·ubuntu·typescript
送鱼的老默2 天前
学习笔记--入门typescript直接案例开搞
前端·typescript
spmcor2 天前
TypeScript 中 null 与 undefined 的区别 —— 一篇彻底搞懂的指南
typescript
烛衔溟2 天前
TypeScript 接口实战 —— 处理复杂嵌套对象
linux·ubuntu·typescript
求学中--3 天前
ArkUI电商首页完整实战
华为·typescript·harmonyos
布局呆星4 天前
Spring Boot+MyBatis-Plus+Vue3前后端协作Note
spring boot·typescript·vue·mybatis
漫游的渔夫4 天前
前端开发者做 AI Agent:别只渲染答案,用 7 个状态接住确认、错误和 trace
前端·人工智能·typescript