'Vercel Failed to compile. React

first, I was getting the same error for react-icons. now I am getting errors for the typewriter. it works fine on localhost. when I'm trying to npm i typewriter getting this error:

also tried CI false doesn't worked.

    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR! 
    npm ERR! While resolving: [email protected]
    npm ERR! Found: [email protected]
    npm ERR! node_modules/react
    npm ERR!   react@"^18.0.0" from the root project
    npm ERR! 
    npm ERR! Could not resolve dependency:
    npm ERR! peer react@"17.x" from [email protected]
    npm ERR! node_modules/typewriter-effect
    npm ERR!   typewriter-effect@"*" 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 /Users/Dave/.npm/eresolve-report.txt for a full report.

    npm ERR! A complete log of this run can be found in:
    npm ERR!     /Users/Dave/.npm/_logs/2022-05-12T15_25_57_631Z-debug-0.log


    Cloning completed: 532.695ms
    Installing build runtime...
    Build runtime installed: 2.177s
    Looking up build cache...
    Build Cache not found
    Installing dependencies...
    npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
    npm WARN deprecated [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
    added 1406 packages in 30s
    172 packages are looking for funding
      run `npm fund` for details
    Detected `package-lock.json` generated by npm 7...
    Running "npm run build"
    > [email protected] build
    > react-scripts build
    Creating an optimized production build...
    Failed to compile.
    Module not found: Error: Can't resolve 'typewriter-effect' in '/vercel/path0/src/components'
    Error: Command "npm run build" exited with 1



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source