[英]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中制作一个应用,所以我通过以下命令在ionic中添加了一些自定义页面:
ionic g page user
But I start ionic server it show error 但是我启动离子服务器显示错误
Runtime Error Cannot find module "../pages/home/home" 运行时错误找不到模块“ ../pages/home/home”
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". 您应该使用grep或您最喜欢的ide在项目范围内进行文本搜索,以找到要导入“ ../pages/home/home”的位置。
Your error doesn't come from your ionic g page user
command as this command only generates a page named user. 您的错误并非来自您的ionic g page user
命令,因为此命令仅生成一个名为user的页面。
It seems like you created a page called home and deleted it without deleting imports. 好像您创建了一个名为home的页面,并在不删除导入的情况下将其删除。
I encountered the same problem when I was github clone code. 当我是github克隆代码时,我遇到了同样的问题。 But this is not the problem with the code itself, but because I used cnpm (npm of the Chinese version). 但这不是代码本身的问题,而是因为我使用了cnpm(中文版本的npm)。 Uninstall npm, install npm. 卸载npm,安装npm。 The problem is solved 问题已经解决了
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.