这是我第一次使用打字稿和尾风。我已经遵循了创建反应应用程序的顺风指南,但是当我尝试运行npm start时,我得到了以下错误:
./src/index.css (./node_modules/css-loader/dist/cjs.js??ref--5-oneOf-4-1!./node_modules/postcss-loader/src??postcss!./src/index.css)
TypeError: Object.entries(...).flatMap is not a function
at Array.forEach (<anonymous>)这是我的index.css
@tailwind base;
@tailwind components;
@tailwind utilities;
body {...我在index.css Unknown at rule @tailwind css(unknownAtRules)收到警告
这是我的index.js
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
// import App from './App';
import reportWebVitals from './reportWebVitals';
ReactDOM.render(
<React.StrictMode>
<div className="px-4 py-2 bg-green-500 text-white font-semibold rounded-lg hover:bg-green-700">tombol</div>
</React.StrictMode>,
document.getElementById('root')
);
reportWebVitals();发布于 2020-12-13 21:17:56
这很奇怪。尝试将您的Node.js更新为最新的当前稳定版本,然后再试一次。
发布于 2020-12-30 22:08:19
通过以下链接中的步骤使用NodeJS更新nvm:https://learn.microsoft.com/en-us/windows/nodejs/setup-on-windows
确保您已经从项目中卸载了前面的node_modules文件夹。
遵循以下步骤
安装RimRaf:
npm install rimraf -g
并在项目文件夹中删除node_modules文件夹,其中:
rimraf node_modules
参考资料:How to Delete node_modules - Deep Nested Folder in Windows
https://stackoverflow.com/questions/65247279
复制相似问题