[英]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.