我在我的Next.js应用程序中安装了终端机。这是我收到的错误消息
error - ./node_modules/next/dist/client/dev/amp-dev.js
Error: Cannot find module 'xwind/babel' 我是这样安装Next.js应用程序的:
npx create-next-app -e with-tailwindcss ./这些是我安装的依赖项:
npm install graphql graphql-request html-react-parser moment react-multi-carousel sass 发布于 2022-09-17 12:00:45
就在几分钟前也发生在我身上。你不知道这是不是同一个案子。它在pages文件夹中为我创建了components文件夹、.babelrc文件和js文件。不知道这是不是你的案子,但我就是这样。以防万一只需在下面使用解决方案。
解决方案
删除.bablerc文件和components文件夹以及pages文件夹中的js文件。
更多细节
这很奇怪,因为如果您查看存储库 of Next.js示例with-tailwindcss。它没有那些。不知道这是怎么发生的。我们可以在评论中详细说明。
另外,babel xwind/babel的插件也有依赖性检查,只允许tailwindcss版本<2。有一个问题。在我看来,这种回购是没有维护的,或者会被分叉取代,作为npm包的主要产品,或者类似的东西。
发布于 2022-09-18 20:34:46
由于某种原因,create应用程序正在安装with-tailwind-emotion模板,而不是with-tailwind。
现在,一个很好的方法是用create应用程序创建一个普通的类型记录模板,然后手动添加顺风。
所以你的步骤是:
第1步:没有打字记录:
npx create-next-app ./或带有打字本:
npx create-next-app --ts ./第2步:
用next.js:https://tailwindcss.com/docs/guides/nextjs安装顺风的文档
https://stackoverflow.com/questions/73737176
复制相似问题