【问题标题】:Compiled with problems. in React编译有问题。在反应
【发布时间】:2022-09-30 00:56:57
【问题描述】:

./node_modules/loaders.css/loaders.css 中的错误 (./node_modules/css-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[1]!. /node_modules/postcss-loader/dist/cjs.js??ruleSet[1].rules[1].oneOf[5].use[2]!./node_modules/source-map-loader/dist/cjs.js! ./node_modules/loaders.css/loaders.css)

模块构建失败(来自 ./node_modules/postcss-loader/dist/cjs.js): 错误:找不到模块“daisyui” 需要堆栈:

  • F:\\VS code\\三个js\\材质tailwind\\Clone\\FriendsZone\\tailwind.config.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\tailwindcss\\lib\\lib\\setupTrackingContext.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\tailwindcss\\lib\\index.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\postcss-loader\\dist\\utils.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\postcss-loader\\dist\\index.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\postcss-loader\\dist\\cjs.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\loader-runner\\lib\\loadLoader.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\loader-runner\\lib\\LoaderRunner.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\webpack\\lib\\NormalModule.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\webpack-manifest-plugin\\dist\\index.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\react-scripts\\config\\webpack.config.js
  • F:\\VS code\\三个js\\material tailwind\\Clone\\FriendsZone\\node_modules\\react-scripts\\scripts\\start.js 在 Function.Module._resolveFilename (节点:internal/modules/cjs/loader:933:15) 在 Function.Module._load (节点:internal/modules/cjs/loader:778:27) 在 Module.require (node:internal/modules/cjs/loader:1005:19) 在需要(节点:内部/模块/cjs/helpers:102:18) 在对象。 (F:\\VS code\\三个js\\materialtailwind\\Clone\\FriendsZone\\tailwind.config.js:46:13) 在 Module._compile (node:internal/modules/cjs/loader:1101:14) 在 Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10) 在 Module.load (node:internal/modules/cjs/loader:981:32) 在 Function.Module._load (node:internal/modules/cjs/loader:822:12) 在 Module.require (node:internal/modules/cjs/loader:1005:19

任何人帮助我,在此先感谢。

  • 很难说这到底是怎么回事,但似乎你错过了一个包裹。尝试重新安装一个包(看起来你缺少顺风?)。如果这不起作用尝试使用强制安装(npm install <package> --f)。

标签: javascript node.js reactjs webpack tailwind-css


【解决方案1】:

首先,尝试检查您实际编写的文件,现代 ide 可以突出显示错误的地方。尝试仔细检查您安装 tailwind 的步骤。没有源代码很难帮助

【讨论】:

    【解决方案2】:

    删除整个节点模块文件夹并重新安装:

    rm -rf node_modules
    npm install
    

    【讨论】:

    • 谢谢回复,不过这个方法我已经用过了,问题还是存在。
    • 您的答案可以通过额外的支持信息得到改进。请edit 添加更多详细信息,例如引用或文档,以便其他人可以确认您的答案是正确的。你可以找到更多关于如何写好答案的信息in the help center
    【解决方案3】:

    刚刚在“postcss.config.js”文件中注释掉了“tailwind css: {}”。问题解决了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2023-03-31
      • 2017-08-02
      • 2012-03-16
      • 1970-01-01
      • 1970-01-01
      • 2016-04-11
      • 1970-01-01
      相关资源
      最近更新 更多