reactjs 无法安装节点模块并在react应用程序下构建

t9eec4r0  于 2023-02-12  发布在  React
关注(0)|答案(1)|浏览(119)
{
   "name": "sample-react",
   "description": "Sample Website",
   "version": "2.0.0",
   "keywords": [
     "xxxx",
   ],
   "repository": {
     "type": "git"
   },
   "scripts": {
     "start": "react-scripts start",
     "build": "react-scripts build",
     "test": "react-scripts test",
     "eject": "react-scripts eject",
     "watch": "cra-build-watch --verbose -p /"
   },
   "dependencies": {
     "@okta/okta-auth-js": "^5.5.0",
     "axios": "^0.21.0",
     "bootstrap": "^3.3.7",
     "bootstrap-select": "^1.13.12",
     "classnames": "^2.2.6",
     "connected-react-router": "^6.5.2",
     "core-js": "^3.8.1",
     "date-fns": "^2.4.1",
     "debounce-promise": "^3.1.2",
     "font-awesome": "^4.6.3",
     "formik": "^2.2.6",
     "immutable": "^4.0.0-rc.12",
     "jquery": "^3.5.1",
     "lodash": "^4.17.15",
     "lodash.debounce": "^4.0.8",
     "luxon": "^1.25.0",
     "match-sorter": "^4.0.1",
     "moment": "^2.24.0",
     "numeral": "^2.0.6",
     "prop-types": "^15.7.2",
     "qs": "^6.9.4",
     "react": "^16.13.0",
     "react-app-polyfill": "^2.0.0",
     "react-block-ui": "^1.3.1",
     "react-bootstrap": "^0.33.1",
     "react-datepicker": "^2.9.6",
     "react-dnd": "^9.4.0",
     "react-dnd-html5-backend": "^9.4.0",
     "react-dom": "^16.13.0",
     "react-file-download": "^0.3.5",
     "react-input-mask": "2.0.4",
     "react-number-format": "^4.4.4",
     "react-overlays": "^1.2.0",
     "react-paginate": "^6.3.0",
     "react-redux": "^7.1.1",
     "react-redux-toastr": "^7.5.1",
     "react-router-bootstrap": "^0.25.0",
     "react-router-dom": "^5.1.0",
     "react-scripts": "^4.0.1",
     "react-select": "^3.1.1",
     "react-table": "^6.10.3",
     "react-table-6": "^6.11.0",
     "reactabular-column-extensions": "^8.9.3",
     "reactabular-dnd": "^8.16.0",
     "reactabular-table": "^8.14.0",
     "redux": "^4.0.4",
     "redux-form": "^8.2.6",
     "redux-thunk": "^2.3.0",
     "sortabular": "^1.6.0",
     "table-resolver": "^4.1.1",
     "use-latest": "^1.2.0",
     "validatorjs": "^3.17.1",
     "yup": "^0.32.8"
   },
   "devDependencies": {
     "cra-build-watch": "^3.2.0"
   },
   "eslintConfig": {
     "extends": "react-app"
   },
   "browserslist": {
     "production": [
       ">0.2%",
       "not dead",
       "not op_mini all"
     ],
     "development": [
       "ie 11",
       "last 1 chrome version",
       "last 1 firefox version",
       "last 1 safari version"
     ]
   }
 }

首先,我得到下面的错误,

unable to resolve dependency tree
npm ERR! Found: react-dnd@9.5.1
npm ERR! node_modules/react-dnd
npm ERR!   react-dnd@"^9.4.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-dnd@">= 2.0.0 < 3.0.0" from reactabular-dnd@8.16.0

下面是我正在使用的软件包,

"reactabular-dnd": "^8.16.0",
"react-dnd": "^9.4.0",

我尝试了两个与遗留对等depsnpm安装成功,但进入另一个问题,如果我运行npm运行构建

dsekswqp

dsekswqp1#

此错误主要是在使用非LTS版本的节点时出现的。
https://nodejs.org/en/download/releases/安装最新的lts版本

相关问题