简体   繁体   English

我无法运行 react web 项目并且 npm install 也无法正常工作

[英]I'm not able to run the react web project and npm install also not working

I'm getting following errors if npm install如果 npm install 我会收到以下错误在此处输入图像描述

i tried clean cache also like this我也尝试过这样的清理缓存在此处输入图像描述

if i directly run the project it's shows react it shows "'react-scripts' is not recognized as an internal or external command"如果我直接运行项目它显示反应它显示“'react-scripts'不被识别为内部或外部命令”

在此处输入图像描述

this is the package.json code used in my project i'm not getting what's the issue bcoz i'm new to react.let me know how to run the project.. thanks in advance..这是我的项目中使用的 package.json 代码我没有得到什么问题,因为我是 react 新手。让我知道如何运行项目..提前谢谢..

{
  "name": "pay-management",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "@emotion/core": "^11.0.0",
    "@emotion/react": "^11.1.5",
    "@fortawesome/fontawesome-svg-core": "^1.2.34",
    "@fortawesome/free-brands-svg-icons": "^5.15.2",
    "@fortawesome/free-solid-svg-icons": "^5.15.2",
    "@fortawesome/react-fontawesome": "^0.1.14",
    "@material-ui/core": "^4.11.1",
    "@material-ui/icons": "^4.9.1",
    "@material-ui/lab": "^4.0.0-alpha.57",
    "@testing-library/jest-dom": "^5.11.4",
    "@testing-library/react": "^11.1.0",
    "@testing-library/user-event": "^12.1.10",
    "autoprefixer": "7",
    "change-case": "^4.1.1",
    "lodash": "^4.17.21",
    "material-ui": "^0.20.2",
    "material-ui-bootstrap": "^2.0.0",
    "moment": "^2.29.1",
    "postcss": "7",
    "postcss-flexbugs-fixes": "4",
    "postcss-preset-env": "^6.7.0",
    "react": "^17.0.1",
    "react-beautiful-dnd": "^13.0.0",
    "react-csv-importer": "^0.3.0",
    "react-dom": "^17.0.1",
    "react-dropzone": "^11.2.4",
    "react-moment": "^1.1.1",
    "react-number-format": "^4.4.4",
    "react-papaparse": "^3.11.1",
    "react-resize-observer": "^1.1.1",
    "react-router-dom": "^5.2.0",
    "react-scripts": "4.0.1",
    "react-table": "^7.6.2",
    "react-timer-mixin": "^0.13.4",
    "web-vitals": "^0.2.4"
  },
  "scripts": {
    "start": "react-scripts start",
    "build": "react-scripts build",
    "test": "react-scripts test",
    "eject": "react-scripts eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "globals": {
    "_": true
  },
  "homepage": "url",
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "@tailwindcssinjs/macro": "^0.17.0",
    "cross-env": "^7.0.2",
    "tailwindcss": "^2.0.1-compat"
  },
  "main": "index.js",
  "author": "",
  "license": "ISC"
}

The error message you're seeing trying to run build makes sense.您在尝试运行构建时看到的错误消息是有道理的。 You can't run your build script if you haven't installed the dependencies first - since you don't have the libraries necessary to compile the project yet!如果您没有先安装依赖项,则无法运行构建脚本 - 因为您还没有编译项目所需的库! npm run build is a synonym for "react-scripts build" according to your package.json file, so you need react (which is part of your dependency list).根据您的 package.json 文件, npm run build是“react-scripts build”的同义词,因此您需要 react(这是您的依赖项列表的一部分)。 You have to solve the dependency conflicts first - then you can run build.您必须先解决依赖冲突 - 然后才能运行 build.

The npm dependecy conflict message tells you the steps to follow in order to solve them, read them and follow those. npm 依赖冲突消息会告诉您为解决它们而应遵循的步骤,阅读它们并遵循它们。 AFTER trying those official steps, if they don't help, as the last resort I would try upgrading manually autoprefixer to be v 10.0.2 ~it appears you installed it manually while developing without knowing tailwind was going to use it internally.在尝试了这些官方步骤之后,如果它们没有帮助,作为最后的手段,我会尝试手动将 autoprefixer 升级为 v 10.0.2 ~看起来你在开发时手动安装了它,但不知道 tailwind 会在内部使用它。

Hope that helps.希望有帮助。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我在处理新的 React 项目时遇到问题。 我已经安装了所有必要的软件包,但仍然无法使用 npm start 运行我的服务器? - I'm having trouble working on a new react project. I've install all the necessary packages but still I can't run my server using npm start? 无法在 mac m1 上为 react 项目运行“npm run build” - cannot run “npm run build” for a react project on mac m1 我正在尝试使用“npm i react-draft-wysiwyg”命令安装软件包,但它不起作用 - I'm trying to install package using 'npm i react-draft-wysiwyg' command but it not working NPM Run Watch 不适用于 React 项目 - NPM Run Watch is Not Working For React Project 我无法使用 npm 安装 gatsby-plugin-transition-link - I'm not able to install gatsby-plugin-transition-link with npm 在 npm install 和 npm start 后找不到 package.json。 该项目在我将其推送到github之前能够运行 - package.json not found after npm install and npm start. The project was able to run before I pushed it to github NPM软件包无法将其安装在React -native项目中 - NPM packages could not able to install it in React -native project 当我运行 npm 时安装反应货币格式。 我收到以下错误? 我能做些什么? - when i run npm install react-currency format . I'm getting the below error? what can i do? 如何在没有 npm install 的情况下从 github 运行 React 项目 - How to run react project from github without npm install 在为 React 项目工作一段时间后,我收到所有“npm install”命令的以下错误 - I am getting following error for all 'npm install' commands after some time working for React project
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM