Search code examples
reactjsnode-modulesimporterror

Can't resolve 'react-image-video-lightbox'


This is my first question on StackOverflow. So might miss out on detailing, so please correct me if needed.

I am facing an issue with one of my imports in reactJs. The package react-image-video-lightbox. I installed the package with "npm i react-image-video-lightbox" and also checked the node_modules, the package is present in node_modules as well.

But for some reason, when i run npm start it is still not able to locate the package.

Project Directory My directory structure

Node Modules (The highlighted one) Package in node_module

The directory structure of react-image-video-lightbox This is how the package looks

The error

Error for the package

The way I am importing Importing the package, look at the highlighted one.

Also, shows up in package suggestion It is also showing up in module suggestion

I am not sure what i am doing wrong. My node version is 12.22, npm is 6.14 and reactjs version is ^16.13.

Any help and suggestions are highly appreciated.

Thanks


Solution

  • Can't resolve 'react-image-video-lightbox' try to execute these commands [

    • yarn cache clean
    • yarn upgrade
    • yarn remove react-image-video-lightbox
    • yarn add react-image-video-lightbox

    ]

    For install recent version