npm install from github: Module not found: Can't resolve 'react-big-calendar'
I was facing same issue. It took 3-4 hours to figure out what is problem. Here is a solution.
- Run Command - npm run build - which build dist and lib folder.
- remove dist and lib from .gitignore file.
- Push your code.
If you see package-lock.json carefully, there is a line "main": "lib/index.js"
which point to lib folder. But when you forked react-big-calendar repo, there was no lib folder in this repo, there was only src folder.
So it was cleared that fisrt you have to build code and push it on your repo.
I had a similar problem, so maybe it would be helpful to someone. main
property from package.json
was pointing to the built file which wasn't accessible, so I added a prepare
script to run build before publishing the package.
"main": "dist/index.js","scripts": { "prepare": "npm run build"}