首页 > 解决方案 > 如何在浏览器上运行反应?

问题描述

我是反应框架的新手,我正在尝试在 Tailwind CSS 的帮助下制作一个 Web 应用程序。当我按照以下步骤操作时,它在浏览器上运行:

npx create-react-app my-project
cd my-project
npm install -D tailwindcss@npm:@tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9
npm install @craco/craco
npx tailwindcss-cli@latest init
npm start

但是当我重新打开编辑器并在终端中运行命令npm start时,会显示以下错误:

PS D:\react1> npm start
npm ERR! Missing script: "start"
npm ERR!
npm ERR! Did you mean one of these?
npm ERR!     npm star # Mark your favorite packages
npm ERR!     npm stars # View packages marked as favorites
npm ERR!
npm ERR! To see a list of scripts, run:
npm ERR!   npm run

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\DELL\AppData\Local\npm-cache\_logs\2021-07-12T09_16_22_570Z-debug.log

请帮助我哪里错了。我按照此页面安装了带有尾风的反应 https://tailwindcss.com/docs/guides/create-react-app 在此处输入图像描述

标签: reactjsnpmtailwind-css

解决方案


尝试

  1. npm 我反应脚本
  2. npm 开始

推荐阅读