You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

升级tedious至18.6.1后,出现Module has no exported member ColumnValue错误

解决tedious 18.x版本中TypeScript导入ColumnValue报错的问题

以下是几个可行的解决步骤,按顺序尝试:

  • 同步@types/tedious版本
    tedious主包升级到18.6.1后,对应的类型定义包@types/tedious可能需要同步更新。执行以下命令安装最新版类型包:

    npm install @types/tedious@latest --save-dev
    

    安装完成后检查package.json,确保@types/tedious的版本与tedious主包版本兼容(通常最新版类型包会适配最新主包)。

  • 调整TypeScript模块解析配置
    打开tsconfig.json,检查moduleResolution字段:

    • 如果当前是"Node"或"Classic",改为"NodeNext"或"Node16"
    • 同时确保module字段设置为"ESNext"或"CommonJS"(与项目模块规范匹配)
      保存配置后重启VS Code的TypeScript服务(Ctrl+Shift+P,选择"TypeScript: Restart TS Server")。
  • 尝试修改导入方式
    若直接导入命名成员失败,换成整体导入后引用:

    import * as tedious from "tedious";
    // 使用时:
    const value: tedious.ColumnValue = ...;
    
  • 清除缓存

    • 清除TypeScript缓存:
      npx tsc --clearCache
      
    • 删除node_modules和package-lock.json,重新执行npm install,避免依赖冲突或旧缓存残留。

内容的提问来源于stack exchange,提问作者Manfred Schneider

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.14 23:29:52