首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >专栏 >Cannot find type definition file for 'axios' and 'file-type'

Cannot find type definition file for 'axios' and 'file-type'

原创
作者头像
望天
修改2025-07-03 17:30:30
修改2025-07-03 17:30:30
1380
举报
文章被收录于专栏:along的开发之旅along的开发之旅
代码语言:txt
复制
ERROR in ./tsconfig.json
./tsconfig.json
[tsl] ERROR
      TS2688: Cannot find type definition file for 'axios'.
  The file is in the program because:
    Entry point for implicit type library 'axios'

ERROR in ./tsconfig.json
./tsconfig.json
[tsl] ERROR
      TS2688: Cannot find type definition file for 'file-type'.
  The file is in the program because:
    Entry point for implicit type library 'file-type'

默认应该会在@types/file-type下面, 查看有这个目录,但是里面的README.md说file-type自带了,不需要安装。

代码语言:txt
复制
cat node_modules/@types/file-type/README.md 
This is a stub types definition for @types/file-type (https://github.com/sindresorhus/file-type#readme).

file-type provides its own type definitions, so you don't need @types/file-type installed!%

所以卸载后试下

代码语言:txt
复制
npm uninstall @types/file-type
npm uninstall @types/axios

yarn dev正常了. 有点反直觉,你以为要安装,实际要卸载

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。

如有侵权,请联系 cloudcommunity@tencent.com 删除。

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档