0

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?

Moe_blg
  • 71
  • 4
  • Does this answer your question? [I am trying to host my react website on netlify but there is a npm install error](https://stackoverflow.com/questions/69351433/i-am-trying-to-host-my-react-website-on-netlify-but-there-is-a-npm-install-error) – the.marolie Mar 24 '23 at 17:36
  • or maybe downgrade the typwritter package to an earlier version which supports react 16 ? – the.marolie Mar 24 '23 at 17:40
  • @the.marolie Thanks a lot, this helped now it's deployed. But I apparently have some fixing to do as the page is all white. I'm not sure how to debug it. – Moe_blg Mar 24 '23 at 18:20
  • nice. check the console.. you might find some errors. – the.marolie Mar 24 '23 at 18:28

0 Answers0