Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fails to install in React 17 #96

Open
stesvis opened this issue Apr 27, 2021 · 3 comments
Open

Fails to install in React 17 #96

stesvis opened this issue Apr 27, 2021 · 3 comments

Comments

@stesvis
Copy link

stesvis commented Apr 27, 2021

I am not sure why, but I am not able to install the package due to ERESOLVE unable to resolve dependency tree.
Here's the full error list:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR!   react@"^17.0.2" from the root project
npm ERR!   peer react@">=15" from [email protected]     
npm ERR!   node_modules/react-owl-carousel
npm ERR!     react-owl-carousel@"*" from the root project      
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^16.14.0" from [email protected]
npm ERR! node_modules/react-owl-carousel/node_modules/react-dom
npm ERR!   react-dom@"16.14.0" from [email protected]   
npm ERR!   node_modules/react-owl-carousel
npm ERR!     react-owl-carousel@"*" 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.

I am kinda new with React so forgive me if the log clearly shows what's wrong and I just can't see it.

@rameshparajuli
Copy link

I also have problem with installation.
after install,

TypeError: Cannot read properties of undefined (reading 'fn')

image

image

@fsjdg
Copy link

fsjdg commented Mar 7, 2022

@stesvis try with npm i react-owl-carousel --legacy-peer-deps

@rameshparajuli You need to inject a global window.jQuery first.

e.g. webpack

// ...
plugins: [
    // other plugins,
    new webpack.ProvidePlugin({
        $: 'jquery',
        jQuery: 'jquery',
        'window.jQuery': 'jquery'
    }),
],
//...

@ulf-frostypaw
Copy link

I'm getting an error like this:
Captura123

this is my code importing jquery lib globaly:

import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import jQuery from "jquery";
import inject from '@rollup/plugin-inject'

// https://vitejs.dev/config/
export default defineConfig({
  plugins: [react(),
  	inject({
      $: 'jquery', // this caused warnings for all my scss files that had $variable
      jQuery: 'jquery',
    }),
  ],
})

HELP xwx

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants