Runtime Error Cannot find module "./app.module" with the latest npm install


#1

I just installed ionic2 with the latest node and npm, but when I created the project with ionic start, after the ionic serve command, it just gave me the Runtime Error as the following. So what’s wrong?

Runtime Error
Cannot find module "./app.module"
Stack
Error: Cannot find module "./app.module"
at Object. (http://localhost:8100/build/main.js:41252:7)
at webpack_require (http://localhost:8100/build/main.js:20:30)
at http://localhost:8100/build/main.js:66:18
at http://localhost:8100/build/main.js:69:10
Ionic Framework: 2.0.0-rc.5
Ionic Native: 2.2.11
Ionic App Scripts: 1.0.0
Angular Core: 2.2.1
Angular Compiler CLI: 2.2.1
Node: 7.4.0
OS Platform: Linux 4.2
Navigator Platform: Linux x86_64
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/51.0.2704.79 Chrome/51.0.2704.79 Safari/537.36


#2

I think I figured it out, it’s just I use the ionic start command wrong.

It must be with a specific template, I used

ionic start xxx --v2

which it should be

ionic start xxx [template name] --v2

After supply the specific template, it just build and serve well.