简体   繁体   中英

ionic:Runtime Error Cannot find module “../pages/home/home”

I want to make an app in ionic, so I add some custom page in ionic by command :

ionic g page user

But I start ionic server it show error

Runtime Error Cannot find module "../pages/home/home"

click for error image

If the app tells you that it misses a file, that's because there's somewhere where you imported this file and it doesn't exist (anymore? maybe you deleted it and forgot to delete an import)

You should make a project-wide text search using grep or your favorite ide to find where you are importing "../pages/home/home".

Your error doesn't come from your ionic g page user command as this command only generates a page named user.

It seems like you created a page called home and deleted it without deleting imports.

I encountered the same problem when I was github clone code. But this is not the problem with the code itself, but because I used cnpm (npm of the Chinese version). Uninstall npm, install npm. The problem is solved

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM