Recently, I ran into an issue after updating my project from Git. The problem arose when trying to use ngx-material-timepicker
in conjunction with the luxon
library.
(It's important to note that ngx-material-timepicker
isn't a new addition to the project, it has been used for quite some time).
However, during the project build, I encountered a module resolution error related to the usage of luxon
.
https://i.sstatic.net/6OElf.png
Upon closer inspection of the errors within each .ts
file, I noticed that Luxon was being referenced from the global TypeScript types directory (
AppData\Local\Microsoft\TypeScript\5.2\node_modules\@types
) instead of locally from within my project (node_modules\@types
). This discrepancy is what's causing the module resolution error during the project build.
https://i.sstatic.net/RxEJy.png
To address this, I took the luxon
module from the global location and placed it in my project's local node_modules\@types
directory. This fixed some issues but now I'm facing the following specific error:
./node_modules/ngx-material-timepicker/fesm2015/ngx-material-timepicker.js:8:0-39 - Error: Module not found: Error: Can't resolve 'luxon' in 'D:\erpweb\ososerp\Web\node_modules\ngx-material-timepicker\fesm2015'
Here are the steps I've taken so far to try to resolve this issue:
- Deleted the
node_modules
folder andpackage-lock.json
from the project. - Executed
npm cache clean --force
. - Removed the 'luxon' folder from the global TypeScript directory.
- Ran
npm i
to reinstall dependencies.
If anyone has any suggestions on how to overcome this hurdle, please let me know.