Caught exception: Error: Cannot find module 'lru-cache'
Hi I tried: ionic start projectname sidemenu
and received the Error:
Error: Cannot find module 'lru-cache'
at Function.Module._resolveFilename (module.js:325:15)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at localpathdeets\npm\node_modules\ionic\node_modules\ionic-app-lib\node_modules\archiver\node_modules\file-utils\node_modules\glob\node_modules\minimatch\minimatch.js:35:11
at Object.
help please????
Could you provide me with the output from ionic info from within your project directory? Thanks, this should help in troubleshooting.
I realize I'm late to the party on this one, but I think I fixed it for myself at least.
The issue with this error, is that you cannot actually use the "ionic info" command when this sort of error is occurring. The error seems to take priority over the ability to get info.
I had the same issue with "Cannot find module 'rx-lite-aggregates'" after subsequently fixing the "Cannot find lru-cache."
What I had to do was actually uninstall ionic locally, and then reinstall each of these individually. Somehow something had gotten screwy between my github repo and the local files. So it turned out that I had not fully committed all of my files, and then later grabbed the repo on another computer, and some of the files were missing which is what caused this error to manifest.
Try this:
- npm uninstall ionic
- npm install lru-cache
From there, you'll probably see that 'lru-cache' isn't the only file that you're missing. Just continue to install each missing module. It's also worth mentioning that I did update my typescript as well-- though I'm fairly certain that this isn't a necessarily step to fix the problem; it's just worth mentioning.
The stack trace in the original issue shows that this is CLI v2. I'm closing this issue as only CLI v3 is supported. Let me know if this is still an issue.