【发布时间】:2022-08-02 21:18:10
【问题描述】:
当我尝试使用 npm run dev 运行我的 Next.js 应用程序时,我收到一条错误消息,指出我没有使用 Typescript 运行 Next 所需的包:
Please install @types/react by running:
npm install --save-dev @types/react
If you are not trying to use TypeScript, please remove the tsconfig.json file from your package root (and any TypeScript files in your pages directory).
但是,模块 \'@types/react\' 已安装。我尝试运行npm install --save-dev @types/react 并没有收到任何错误消息(只是一堆警告,但我不认为它们是问题所在)。
我该如何解决这个问题并运行项目?
标签: javascript reactjs typescript npm next.js