Ionic2 folder structure missing app folder

2019-07-24 14:05发布

问题:

I'm starting to learn Ionic2, I have create a new empty project with ionic start myproject blank --v2 and everything works correctly if I do ionic serve.

Then I read this tutorial and many others. All of them state that the ionic folder structure should have an app folder:

If I look at my project folder structure I can't see any app folder. My structure looks so:

- hooks
- plugins
- scss
- www
  -index.html  
  - css
  - img 
  - js
  - lib
- bower.json
- config.xml
- gulpfile.js
- ionic.project
- package.json

Now I'd like to follow this tutorial in order to build my first application but as you can see the folder structure of that example is different from mine and as an Ionic beginner I'm a little confused.

FIY (if it matters):

I'm referring to this page for the templates.

cordova -v: 6.2.0
ionic -v: 1.7.15

回答1:

It might because your Node.js needs update.

First use node --version in your terminal (if you use Mac) to check the version of your Node.js. I had the same problem with you when node version in my Mac was v5.10.1 and solved it by using brew upgrade node to upgrade my Node.js to v6.3.1.

After updating your Node.js to the latest version just use ionic start myProject --v2 to create a new project and then the new project you created should have /app inside.