Overriding dependencies on npm install - javascript

I'm working on an application that I inherited. Upon doing an npm install, initially I got various messages that packages have been either deprecated or they were soon to be end of life. So I started upgrading some of the packages and now I'm running into some dependency issues. I don't really know how to approach this situation, but below is the package.jsonand also the output of the npm install. Any advice would be appreciated.
package.json
{
"name": "guide-front-end",
"version": "1.0.8",
"license": "MIT",
"angular-cli": {},
"scripts": {
"graphqltest": "mocha --require babel-core/register server_src/graphql/tests/test.spec.js --reporter spec",
"dockerstart": "node dist/app.js",
"dockerstart-noangular": "node dist/app --noangular",
"lint": "tslint \"src/**/*.ts\"",
"test": "ng test",
"pree2e": "webdriver-manager update",
"e2e": "protractor",
"prodbuild": "ng build --prod --aot",
"build": "npm run clean && npm run prodbuild && npm run babel-build",
"build-graphql": "babel ./server_src -s -d ./dist --copy-files",
"clean": "rm -rf dist && mkdir dist",
"ng-build": "ng build --prod --aot",
"babel-build": "babel ./server_src -d ./dist -s --copy-files --ignore spec.js,testharness.js"
},
"private": true,
"dependencies": {
"#angular/common": "^4.0.0",
"#angular/compiler": "^4.0.0",
"#angular/core": "^4.0.0",
"#angular/forms": "^4.0.0",
"#angular/http": "^4.0.0",
"#angular/platform-browser": "^4.0.0",
"#angular/platform-browser-dynamic": "^4.0.0",
"#angular/router": "^4.0.0",
"#apollo/server": "^4.3.2",
"#ngrx/core": "^1.2.0",
"#ngrx/store": "^2.2.1",
"angular-expressions": "^0.3.0",
"angular2-cookie": "^1.2.6",
"apollo-angular": "0.13.0",
"apollo-client": "1.8.1",
"babel-core": "^6.24.0",
"body-parser": "^1.19.0",
"cookie-parser": "^1.4.3",
"core-js": "^2.4.1",
"docxtemplater": "^3.0.3",
"express": "^4.17.1",
"express-url-rewrite": "^1.0.2",
"express-winston": "^2.3.0",
"graphql": "^0.10.5",
"graphql-anywhere": "^2.2.0",
"graphql-server-core": "^1.1.0",
"graphql-server-express": "^1.1.0",
"graphql-tag": "^1.1.2",
"graphql-tools": "^0.10.1",
"isomorphic-fetch": "^2.2.1",
"iterall": "^1.0.3",
"jszip": "^2.6.1",
"lodash": "^4.17.15",
"minimist": "^1.2.0",
"morgan": "^1.9.1",
"ngx-bootstrap": "^1.6.6",
"node-fetch": "^2.6.0",
"node-sass": "^4.13.1",
"object-assign": "^4.1.1",
"redux": "^3.6.0",
"request-digest": "^1.0.13",
"rxjs": "^5.0.1",
"serve-favicon": "^2.5.0",
"trim-character": "^2.0.1",
"tsickle": "^0.21.6",
"tsutils": "^1.4.0",
"web-animations-js": "^2.3.1",
"winston": "^2.3.1",
"winston-loggly": "^1.3.1",
"xmlhttprequest": "^1.8.0",
"zone.js": "^0.8.8"
},
"devDependencies": {
"#angular/cli": "^1.0.0",
"#angular/compiler-cli": "^4.0.3",
"#types/async": "^2.0.31",
"#types/graphql": "^0.8.6",
"#types/jasmine": "2.5.38",
"#types/node": "^7.0.12",
"babel-plugin-inline-import": "^2.0.1",
"babel-preset-es2015": "^6.24.0",
"babel-preset-react": "^6.23.0",
"babel-preset-stage-0": "^6.16.0",
"chai": "^3.5.0",
"codelyzer": "~2.0.0-beta.1",
"graphql-tester": "0.0.5",
"graphql-typings": "0.0.1-beta-2",
"jasmine-core": "2.5.2",
"jasmine-spec-reporter": "2.5.0",
"karma": "1.2.0",
"karma-chrome-launcher": "^2.0.0",
"karma-cli": "^1.0.1",
"karma-jasmine": "^1.0.2",
"karma-remap-istanbul": "^0.2.1",
"mocha": "^3.2.0",
"protractor": "^4.0.14",
"ts-node": "1.2.1",
"tslint": "^4.5.1",
"typescript": "2.3.4"
}
}
npm install output
$ npm install
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: #apollo/cache-control-types#1.0.2
npm WARN Found: graphql#0.10.5
npm WARN node_modules/graphql
npm WARN graphql#"^0.10.5" from the root project
npm WARN 8 more (#graphql-typed-document-node/core, apollo-client, ...)
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer graphql#"14.x || 15.x || 16.x" from #apollo/cache-control-types#1.0.2
npm WARN node_modules/#apollo/cache-control-types
npm WARN #apollo/cache-control-types#"^1.0.2" from #apollo/server#4.3.2
npm WARN node_modules/#apollo/server
npm WARN
npm WARN Conflicting peer dependency: graphql#16.6.0
npm WARN node_modules/graphql
npm WARN peer graphql#"14.x || 15.x || 16.x" from #apollo/cache-control-types#1.0.2
npm WARN node_modules/#apollo/cache-control-types
npm WARN #apollo/cache-control-types#"^1.0.2" from #apollo/server#4.3.2
npm WARN node_modules/#apollo/server
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #apollo/server#4.3.2
npm ERR! Found: graphql#0.10.5
npm ERR! node_modules/graphql
npm ERR! graphql#"^0.10.5" from the root project
npm ERR! peer graphql#"^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" from #graphql-typed-document-node/core#3.1.1
npm ERR! node_modules/#graphql-typed-document-node/core
npm ERR! #graphql-typed-document-node/core#"^3.1.1" from #graphql-tools/utils#9.2.0
npm ERR! node_modules/#graphql-tools/utils
npm ERR! #graphql-tools/utils#"9.2.0" from #graphql-tools/merge#8.3.17
npm ERR! node_modules/#graphql-tools/merge
npm ERR! #graphql-tools/merge#"8.3.17" from #graphql-tools/schema#9.0.15
npm ERR! node_modules/#graphql-tools/schema
npm ERR! 1 more (#graphql-tools/schema)
npm ERR! 7 more (apollo-client, graphql-tag, apollo-server-core, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer graphql#"^16.6.0" from #apollo/server#4.3.2
npm ERR! node_modules/#apollo/server
npm ERR! #apollo/server#"^4.3.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: graphql#16.6.0
npm ERR! node_modules/graphql
npm ERR! peer graphql#"^16.6.0" from #apollo/server#4.3.2
npm ERR! node_modules/#apollo/server
npm ERR! #apollo/server#"^4.3.2" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR!
npm ERR! For a full report see:
npm ERR! C:\Users\isandozi\AppData\Local\npm-cache\_logs\2023-02-04T21_15_50_537Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\isandozi\AppData\Local\npm-cache\_logs\2023-02-04T21_15_50_537Z-debug-0.log

Related

Updating NPM Packages Fails

My package.json file:
{
"name": "...",
"version": "0.1.0",
"private": true,
"dependencies": {
"#material-ui/core": "^4.12.4",
"apollo-client": "^1.9.2",
"bootstrap": "4.0.0-alpha.6",
"glamor": "^2.20.40",
"glamorous": "^4.9.1",
"history": "^4.7.2",
"jwt-decode": "^2.2.0",
"lodash": "^4.17.4",
"moment": "2.18.1",
"normalize.css": "^7.0.0",
"polished": "^1.7.0",
"prop-types": "^15.6.0",
"qs": "^6.5.1",
"react": "^17.0.0",
"react-addons-css-transition-group": "^15.6.2",
"react-addons-transition-group": "^15.6.2",
"react-apollo": "^1.4.15",
"react-bootstrap": "^0.31.3",
"react-burger-menu": "^3.0.8",
"react-day-picker": "^6.2.1",
"react-dom": "^17.0.0",
"react-loader": "^2.4.2",
"react-rangeslider": "^2.2.0",
"react-rating-stars-component": "^2.2.0",
"react-redux": "^5.0.6",
"react-router": "^4.2.0",
"react-router-bootstrap": "^0.24.4",
"react-router-dom": "^4.2.2",
"react-scripts": "1.0.14",
"react-select": "^1.0.0-rc.10",
"react-stripe-elements": "^1.0.1",
"react-transition-group": "^2.2.1",
"reactstrap": "^4.8.0",
"redux": "^3.7.2",
"redux-form": "^7.1.0",
"redux-logger": "^3.0.6",
"redux-pack": "^0.1.5",
"redux-thunk": "^2.2.0",
"revalidate": "^1.2.0"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"lint": "eslint src",
"eject": "react-scripts eject"
},
"devDependencies": {
"eslint": "^4.7.2",
"eslint-config-4catalyzer-react": "^0.3.3",
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.6.1",
"eslint-plugin-react": "^7.4.0"
}
}
I'm in the process of updating my codebase.
I want to be able to update a single package, then test out my application then move on to updating another package.
What command should I use for the update process? npm update or npm install?
I tried npm update redux and received the following error:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-apollo#1.4.16
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.0" from the root project
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.12.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.12.4" from the root project
npm ERR! 14 more (react-transition-group, #material-ui/styles, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"0.14.x || 15.* || ^15.0.0 || ^16.0.0" from react-apollo#1.4.16
npm ERR! node_modules/react-apollo
npm ERR! react-apollo#"^1.4.15" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#16.14.0
npm ERR! node_modules/react
npm ERR! peer react#"0.14.x || 15.* || ^15.0.0 || ^16.0.0" from react-apollo#1.4.16
npm ERR! node_modules/react-apollo
npm ERR! react-apollo#"^1.4.15" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
What does the error exactly mean? And how would I fix it? Without having to --force or --legacy-peer-deps?
In this error, there is a compatibility issue with 2 dependencies.
react-apollo#1.4.16 does not support react 17 version
Material UI v4 does not officially support React v17
material4 is not compatible with react17

heoku is not finding ws (websocket)

I have an App that locally works.
$env:ENV="local"
npm run dev
Its Package.json
{
"name": "forge-dataviz-iot-reference-app",
"version": "0.3.3",
"description": "Autodesk Forge Viewer Data Visualization Sample Application",
"main": "server/localserver.js",
"engines": {
"node": "14.19.2"
},
"scripts": {
"postinstall": "cd server && npm install",
"dev": "concurrently --kill-others \"npm run watch\" \"npm run start\" \"nodemon server/localserver.js --delay 300ms --ext js,jsx\"",
"start": "ws -p 9081",
"watch": "webpack --watch --config webpack.config.js",
"dev-client": "npm install && concurrently --kill-others \"npm run watch\" \"npm run start\"",
"build": "webpack --config webpack.config.js"
},
"repository": {
"type": "git",
"url": "https://github.com/Autodesk-Forge/forge-dataviz-iot-reference-app.git"
},
"author": "Autodesk Inc.",
"license": "MIT",
"devDependencies": {
"#babel/core": "^7.0.0-beta.41",
"#babel/plugin-transform-spread": "^7.13.0",
"#babel/preset-env": "7.12.11",
"#babel/preset-react": "7.12.13",
"babel-loader": "^8.1.0",
"concurrently": "^3.5.1",
"css-loader": "3.6.0",
"local-web-server": "4.2.1",
"mini-css-extract-plugin": "^1.4.0",
"node-loader": "^1.0.2",
"node-sass": "^5.0.0",
"nodemon": "2.0.7",
"react": "16.13.1",
"react-dom": "16.13.1",
"sass-loader": "^10.1.1",
"svg-url-loader": "^7.1.1",
"webpack": "^5.11.0",
"webpack-cli": "^4.5.0",
"webpack-node-externals": "^1.7.2"
},
"dependencies": {
"#hig/theme-data": "^2.17.0",
"#material-ui/core": "^4.11.0",
"#material-ui/icons": "^4.9.1",
"#material-ui/lab": "^4.0.0-alpha.56",
"chronos-etu": "3.1.0",
"codemirror": "^5.61.1",
"echarts": "^4.9.0",
"echarts-for-react": "^2.0.16",
"forge-dataviz-iot-data-modules": "0.1.11",
"forge-dataviz-iot-react-components": "0.1.17",
"lodash": "^4.17.15",
"moment": "^2.27.0",
"pixi.js": "^5.3.7",
"q": "^1.5.1",
"react-codemirror2": "^7.2.1",
"react-copy-to-clipboard": "^5.0.3",
"react-dates": "^21.8.0",
"react-rnd": "^10.2.1",
"react-router-dom": "5.2.0",
"socket.io": "^3.0.4",
"socket.io-client": "^3.0.4",
"ws": "^6.2.2",
"uuid": "^8.3.2"
}
}
Procfile // IS IT OK???
$env:ENV="local"
web: npm run dev
Error
heroku logs --tail
2022-06-01T05:23:27.918673+00:00 app[web.1]: > forge-dataviz-iot-reference-app#0.3.3 start /app
2022-06-01T05:23:27.918673+00:00 app[web.1]: > ws -p 9081
2022-06-01T05:23:27.918674+00:00 app[web.1]:
2022-06-01T05:23:27.929836+00:00 app[web.1]: sh: 1: ws: not found
2022-06-01T05:23:27.935528+00:00 app[web.1]: npm ERR! code ELIFECYCLE
2022-06-01T05:23:27.935911+00:00 app[web.1]: npm ERR! syscall spawn
2022-06-01T05:23:27.936120+00:00 app[web.1]: npm ERR! file sh
2022-06-01T05:23:27.936316+00:00 app[web.1]: npm ERR! errno ENOENT
2022-06-01T05:23:27.945101+00:00 app[web.1]: npm ERR! forge-dataviz-iot-reference-app#0.3.3 start: `ws -p 9081`
2022-06-01T05:23:27.945232+00:00 app[web.1]: npm ERR! spawn ENOENT
2022-06-01T05:23:27.945381+00:00 app[web.1]: npm ERR!
2022-06-01T05:23:27.945506+00:00 app[web.1]: npm ERR! Failed at the forge-dataviz-iot-reference-app#0.3.3 start script.
2022-06-01T05:23:27.945622+00:00 app[web.1]: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Someone please download app (if required) from link to findout this problem.
I tried:
1: npm install --save ws
2: npm install --save ws#6.2.2
3:put it in package.json // originally it was not there.
4:delete node modules and installed again
5: delete app and made new one
But the error is still there. How can I make it work on Heroku?

i am just trying to install the package of react js but i am getting errors

I am just trying to install react but I am getting errors.
I have installed npm -v 8.12.1 version in my system. I have tried to downgrade react but it doesn't help
I have tried these type:
update npm npm install npm -g
downgraded react to "react": "15.3.0"
cleared cache: npm cache clear
removed node_modules, rm -rf node_modules,
reinstalled node_modules, npm install
{
"name": "ant-design-pro",
"version": "2.0.0",
"description": "An out-of-box UI solution for enterprise applications",
"private": true,
"scripts": {
"precommit": "npm run lint-staged",
"presite": "node ./scripts/generateMock.js && cd functions && npm install",
"start": "cross-env APP_TYPE=site umi dev",
"start:no-mock": "cross-env MOCK=none umi dev",
"build": "umi build",
"site": "npm run presite && cross-env APP_TYPE=site npm run build && firebase deploy",
"analyze": "cross-env ANALYZE=1 umi build",
"lint:style": "stylelint \"src/**/*.less\" --syntax less",
"lint": "eslint --ext .js src mock tests && npm run lint:style",
"lint:fix": "eslint --fix --ext .js src mock tests && npm run lint:style",
"lint-staged": "lint-staged",
"lint-staged:js": "eslint --ext .js",
"test": "umi test",
"test:component": "umi test ./src/components",
"test:all": "node ./tests/run-tests.js",
"prettier": "prettier --write ./src/**/**/**/*",
"docker:dev": "docker-compose -f ./docker/docker-compose.dev.yml up",
"docker:build": "docker-compose -f ./docker/docker-compose.dev.yml build",
"docker-prod:dev": "docker-compose -f ./docker/docker-compose.yml up",
"docker-prod:build": "docker-compose -f ./docker/docker-compose.yml build"
},
"dependencies": {
"#antv/data-set": "^0.9.6",
"#babel/runtime": "^7.0.0",
"antd": "^3.11.6",
"bizcharts": "^3.2.2",
"bizcharts-plugin-slider": "^2.0.3",
"classnames": "^2.2.6",
"dva": "^2.4.0",
"enquire-js": "^0.2.1",
"hash.js": "^1.1.5",
"highlight.js": "^9.13.1",
"lodash": "^4.17.10",
"lodash-decorators": "^6.0.0",
"marked": "^0.5.2",
"memoize-one": "^4.0.0",
"moment": "^2.22.2",
"numeral": "^2.0.6",
"nzh": "^1.0.3",
"omit.js": "^1.0.0",
"path-to-regexp": "^2.4.0",
"prop-types": "^15.5.10",
"qs": "^6.5.2",
"rc-animate": "^2.4.4",
"react": "^16.8.6",
"react-container-query": "^0.11.0",
"react-copy-to-clipboard": "^5.0.1",
"react-document-title": "^2.0.3",
"react-dom": "^16.8.6",
"react-fittext": "^1.0.0",
"react-router-dom": "^4.3.1",
"save": "^2.3.2",
"simplemde": "^1.11.2"
},
"devDependencies": {
"#types/react": "^16.4.11",
"#types/react-dom": "^16.0.6",
"antd-pro-merge-less": "^0.0.9",
"antd-pro-theme-webpack-plugin": "^1.1.8",
"babel-eslint": "^9.0.0",
"babel-plugin-transform-decorators-legacy": "^1.3.5",
"cross-env": "^5.1.1",
"cross-port-killer": "^1.0.1",
"enzyme": "^3.4.4",
"eslint": "^5.4.0",
"eslint-config-airbnb": "^17.0.0",
"eslint-config-prettier": "^3.0.1",
"eslint-plugin-babel": "^5.1.0",
"eslint-plugin-compat": "^2.5.1",
"eslint-plugin-import": "^2.8.0",
"eslint-plugin-jsx-a11y": "^6.0.3",
"eslint-plugin-markdown": "^1.0.0-beta.6",
"eslint-plugin-react": "^7.11.1",
"gh-pages": "^2.0.0",
"husky": "^0.14.3",
"lint-staged": "^7.2.0",
"merge-umi-mock-data": "^0.0.3",
"mockjs": "^1.0.1-beta3",
"prettier": "1.14.2",
"pro-download": "^1.0.1",
"stylelint": "^9.4.0",
"stylelint-config-prettier": "^4.0.0",
"stylelint-config-standard": "^18.0.0",
"umi": "^2.1.1",
"umi-plugin-ga": "^1.0.3",
"umi-plugin-react": "^1.1.1"
},
"optionalDependencies": {
"puppeteer": "^1.6.0"
},
"lint-staged": {
"**/*.{js,jsx,less}": [
"prettier --write",
"git add"
],
"**/*.{js,jsx}": "npm run lint-staged:js",
"**/*.less": "stylelint --syntax less"
},
"engines": {
"node": ">=8.0.0"
},
"browserslist": [
"> 1%",
"last 2 versions",
"not ie <= 10"
]
}
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-fittext#1.0.0
npm ERR! Found: react#16.14.0
npm ERR! node_modules/react
npm ERR! react#"^16.8.6" from the root project
npm ERR! peer react#"^0.14.0 || ^15.0.0 || ^16.0.0" from #ant-design/create-react-context#0.2.5
npm ERR! node_modules/#ant-design/create-react-context
npm ERR! #ant-design/create-react-context#"^0.2.4" from antd#3.26.20
npm ERR! node_modules/antd
npm ERR! antd#"^3.11.6" from the root project
npm ERR! 1 more (umi-plugin-react)
npm ERR! #ant-design/create-react-context#"^0.2.4" from rc-mentions#0.4.2
npm ERR! node_modules/rc-mentions
npm ERR! rc-mentions#"~0.4.0" from antd#3.26.20
npm ERR! node_modules/antd
npm ERR! antd#"^3.11.6" from the root project
npm ERR! 1 more (umi-plugin-react)
npm ERR! 2 more (rc-tabs, rc-tree)
npm ERR! 47 more (#ant-design/icons-react, airbnb-prop-types, antd, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^15.0.0" from react-fittext#1.0.0
npm ERR! node_modules/react-fittext
npm ERR! react-fittext#"^1.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react#15.7.0
npm ERR! node_modules/react
npm ERR! peer react#"^15.0.0" from react-fittext#1.0.0
npm ERR! node_modules/react-fittext
npm ERR! react-fittext#"^1.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\91639\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\91639\AppData\Local\npm-cache\_logs\2022-06-03T09_27_25_556Z-debug-0.log
As the error reads, you have dependency conflict.
Run the command with --legacy-peer-deps.
npm install --legacy-peer-deps

can't install dependencies because of node and webpack version conflict

I am trying to install the dependencies with the exact version which are listed in json file, and I got errors below:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: webpack#4.46.0
npm ERR! node_modules/webpack
npm ERR! webpack#"^4.35.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer webpack#"^5.1.0" from terser-webpack-plugin#5.3.1
npm ERR! node_modules/terser-webpack-plugin
npm ERR! dev terser-webpack-plugin#"^5.1.1" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
since the dependencies with the required version are not the latest one, I downgrade my node.js from latest version 16 to 14+, and install with npm i --leacy-peer-deps, but the error shows still the same, seems the version from node or webpack still not compatible to the dependencies(Found: webpack#4.46.0
npm ERR! node_modules/webpack
npm ERR! webpack#"^4.35.3" from the root project).
how can I solve this problem?
here is the json list:
{
"name": "example-project",
"version": "1.0.0",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node src/server/index.js",
"build-prod": "webpack --config webpack.prod.js",
"build-dev": "webpack-dev-server --config webpack.dev.js --open"
},
"keywords": [],
"author": "",
"license": "ISC",
"description": "",
"dependencies": {
"dotenv": "^8.2.0",
"express": "^4.17.1",
"jest-fetch-mock": "^3.0.3",
"webpack": "^4.35.3",
"webpack-cli": "^3.3.5"
},
"devDependencies": {
"#babel/core": "^7.13.15",
"#babel/plugin-transform-modules-commonjs": "^7.13.8",
"#babel/preset-env": "^7.13.15",
"babel-loader": "^8.2.2",
"body-parser": "^1.19.0",
"clean-webpack-plugin": "^3.0.0",
"cors": "^2.8.5",
"css-loader": "^5.2.1",
"html-webpack-plugin": "^3.2.0",
"jest": "^26.6.3",
"mini-css-extract-plugin": "^1.4.1",
"node-fetch": "^2.6.1",
"node-sass": "^5.0.0",
"optimize-css-assets-webpack-plugin": "^5.0.4",
"sass": "^1.32.8",
"sass-loader": "^10.1.1",
"style-loader": "^2.0.0",
"terser-webpack-plugin": "^5.1.1",
"webpack-dev-server": "^3.11.2",
"workbox-webpack-plugin": "^6.1.5"
}
}
Try to delete package-lock.json and clear npm cache using 'npm cache clean -f' before npm i.
Caret (^) notation: It will update you to all future minor/patch versions, without incrementing the major version. ^2.3.4 will use releases from 2.3.4 to <3.0.0
Tilde ( ~ ): It will update you to all future patch versions, without incrementing the minor version. ~1.2.3 will use releases from 1.2.3 to <1.3.

React js dependency conflict

I have the following dependencies:
"dependencies": {
"#date-io/moment": "^2.13.1",
"#material-ui/core": "^4.11.4",
"#material-ui/icons": "^4.11.2",
"#material-ui/lab": "^4.0.0-alpha.58",
"#material-ui/pickers": "3.3.10",
"#pdftron/webviewer": "^8.3.0",
"#testing-library/jest-dom": "^5.16.2",
"#testing-library/react": "^12.1.3",
"#testing-library/user-event": "^13.5.0",
"docxtemplater": "^3.29.0",
"file-saver": "2.0.5",
"lodash": "4.17.21",
"moment": "^2.29.1",
"pizzip": "^3.1.1",
"postcss": "^8.4.7",
"react": "^17.0.2",
"react-dark-mode-toggle": "0.2.0",
"react-dom": "^16.13.1",
"react-dropzone": "^12.0.4",
"react-gh-like-diff": "^2.0.2",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"react-transition-group": "^4.4.2",
"styled-components": "^5.3.3"
},
"devDependencies": {
"gh-pages": "^3.1.0",
"postcss-cli": "^8.3.1",
"tailwindcss": "^2.1.2"
}
I am getting the following error from github when the build is done, but I don't understand how I should go about fixing the problem.
Should I lower the version of react or some other dependency?
npm ERR! While resolving: subFormat#0.0.1
npm ERR! Found: react#17.0.2
npm ERR! node_modules/react
npm ERR! react#"^17.0.2" from the root project
npm ERR! peer react#"^16.8.0 || ^17.0.0" from #material-ui/core#4.11.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.11.4" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.14.0" from react-dom#16.14.0
npm ERR! node_modules/react-dom
npm ERR! react-dom#"^16.13.1" from the root project
npm ERR! peer react-dom#"^16.8.0 || ^17.0.0" from #material-ui/core#4.11.4
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"^4.11.4" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/runner/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-03-01T12_22_39_479Z-debug-0.log
Error: Process completed with exit code 1.

Categories