I'm trying to use a NPM package which i downloaded from GitHub, but having no luck.
I created a lib
folder in my src directory of my create-react-app project.
Then i used wget to download the tarball
wget https://github.com/frontend-collective/react-image-lightbox/tarball/master/master.tar.gz
I then changed the name of the tarball
mv master.tar.gz react-image-lightbox-5.2.0.tar.gz
Then I installed the package using NPM
npm install ./src/lib/react-image-lightbox-5.2.0.tar.gz
In my package.json it shows;
"react-image-lightbox": "file:src/lib/react-image-lightbox-5.2.0.tar.gz",
So that all worked nicely.
But when i try and import the package using;
import Lightbox from 'react-image-lightbox';
i get the following error message when doing a npm run build
Cannot find module: 'react-image-lightbox'. Make sure this package is installed.
You can install this package by running: npm install react-image-lightbox.
Im missing something but I cant figure out what.
Any help would be greatly appreciated.