ionic-cli icon indicating copy to clipboard operation
ionic-cli copied to clipboard

Caught exception: Error: Cannot find module 'lru-cache'

Open leighli opened this issue 10 years ago • 3 comments

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. (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:1057:3) at Module._compile (module.js:409:26) at Object.Module._extensions..js (module.js:416:10) at Module.load (module.js:343:32) at Function.Module._load (module.js:300:12)

help please????

leighli avatar Sep 19 '16 00:09 leighli

Could you provide me with the output from ionic info from within your project directory? Thanks, this should help in troubleshooting.

jthoms1 avatar Sep 27 '16 20:09 jthoms1

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:

  1. npm uninstall ionic
  2. 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.

SliceofCheese avatar Sep 26 '17 01:09 SliceofCheese

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.

imhoffd avatar Sep 26 '17 15:09 imhoffd