Next.js 13 -无法解析'supports-color'

1mrurvl1  于 2023-04-20  发布在  其他
关注(0)|答案(1)|浏览(119)

我目前正在开发一个Next.js 13应用程序(使用TypeScript)。我也是Sendgrid npm包。
我经常收到这样的警告:
Module not found: Can't resolve 'supports-color' in '.../node_modules/debug/src'
运行:npm install supports-colornpm install debug@latest并没有修复它,它只是给予了这个错误:

Module not found: ESM packages (supports-color) need to be imported. Use 'import' to reference the package instead

我在任何地方都使用import我已经缩小了它的范围当我使用Sendgridnpm package时发生,但我不知道为什么Sendgrid会导致这个错误。
任何想法都将受到高度赞赏。

2q5ifsrm

2q5ifsrm1#

在debug的GitHub上有一个公开的问题,详细说明了here的问题。安装"supports-color": "^8.1.1"作为一种解决方法,为我解决了这个错误。

npm i supports-color@8.1.1

相关问题