While developing a web app I used package called typewriter-effect. https://www.npmjs.com/package/typewriter-effect
by using --legacy-peer-deps, it worked fine in dev. Now I'm trying to deploy the project on Netlify. It needs to build the project so I specified npm run build which works on my dev environment but everytime Netlify tries to deploy it fails giving the following error.
5:59:02 PM: npm ERR! code ERESOLVE
5:59:02 PM: npm ERR! ERESOLVE unable to resolve dependency tree
5:59:02 PM: npm ERR!
5:59:02 PM: npm ERR! While resolving: personalPortfolio@1.0.0
5:59:02 PM: npm ERR! Found: react@16.14.0
5:59:03 PM: Failed during stage 'building site': Build script returned non-zero exit code: 1 (https://ntl.fyi/exit-code-1)
5:59:02 PM: npm ERR! node_modules/react
5:59:02 PM: npm ERR! react@"^16.8.0" from the root project
5:59:02 PM: npm ERR!
5:59:02 PM: npm ERR! Could not resolve dependency:
5:59:02 PM: npm ERR! peer react@"^17.x || ^18.x" from typewriter-effect@2.19.0
5:59:02 PM: npm ERR! node_modules/typewriter-effect
5:59:02 PM: npm ERR! typewriter-effect@"^2.19.0" from the root project
5:59:02 PM: npm ERR!
5:59:02 PM: npm ERR! Fix the upstream dependency conflict, or retry
5:59:02 PM: npm ERR! this command with --force, or --legacy-peer-deps
5:59:02 PM: npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
5:59:02 PM: npm ERR!
5:59:02 PM: npm ERR! See /opt/buildhome/.npm/eresolve-report.txt for a full report.
5:59:02 PM: npm ERR! A complete log of this run can be found in:
5:59:02 PM: npm ERR! /opt/buildhome/.npm/_logs/2023-03-24T16_58_57_784Z-debug-0.log
5:59:02 PM: Error during npm install
5:59:02 PM: Build was terminated: Build script returned non-zero exit code: 1
5:59:02 PM: Failing build: Failed to build site
5:59:03 PM: Finished processing build request in 13.11s
When I looked into the package.json for typewriter-effect I found the following:
"peerDependencies": {
"react": "^17.x || ^18.x",
"react-dom": "^17.x || ^18.x"
},
But my project has the following
"react": "^16.8.0",
"react-dom": "^16.8.0",
If I update the react version, many other packages will give me errors, what can I do in this case?