How can i update to alpha48? Im using the alpha42.
I updated the package.json
file to"ionic-framework": "2.0.0-alpha.48"
, and then run npm install
. Oh, but before i removed the ionic-framework
folder from node_modules
.
But i got some error in the npm install
├── UNMET PEER DEPENDENCY angular2@2.0.0-alpha.52
└── ionic-framework@2.0.0-alpha.48
npm WARN EPEERINVALID ionic-framework@2.0.0-alpha.48 requires a peer of angular2@2.0.0-beta.0 but none was installed.
And then i tried to use the new modal as it was changed in the .47 version, but it says the Modal.create()
don’t exist. So i think my update didn’t work.
What i did wrong? Or is there a easier way to update the ionic version? Thanks
The best way to update is to update your cli
then create a new project and compare the config files like package.json, webpack.config.js...
and then remove the node_modules
dir.
After npm i
errors will popup as hell due to breaking changes, start fixing them, also take in account the changelog which fortunately for you starts from alpha.42
: https://github.com/driftyco/ionic2/blob/master/CHANGELOG.md
I think you didn’t understood what i said about the modals, im trying to use the modal from alpha.47
.
They changed the way to open/close the modals, and when i try to use the “new” way it says the method don’t exist. But if i try to use the older method(alpha.42
) it works, so i think my update din’t work.
And what u said about the package.json
remove node_modules
, it is exactly what i did no?
The error i got from the npm install was:
├── UNMET PEER DEPENDENCY angular2@2.0.0-alpha.52
└── ionic-framework@2.0.0-alpha.48
npm WARN EPEERINVALID ionic-framework@2.0.0-alpha.48 requires a peer of angular2@2.0.0-beta.0 but none was installed.
My angular in mypackage.json
is:
"angular2": "2.0.0-alpha.52"
Maybe i should update that before the ionic?
Sorry, forget to write some things in last response, basically you should create a new project and compare the current one, then look to changelog for the breaking changes.
I updated the previous answer, it was lacking some explanation to make sense.
Thanks man, the update is working now.
I’m just looking at the structure in the alpha.48
and they moved the app folder outside the www, do you have any idea why they did that? And what should i put in the www now?
With the new folder structure they aimed to keep the source code out of the www folder that is the one where the transpiled js, css and the html will live, also is the folder that will be compiled to the apk in android case, this way only the transpiled code will go in the binary of the app, thus reducing the size of the app after build.
As what you should put in the www
, it depends on what you need, basically all your /app/**/*.js
will be transpiled along with the dependencies you required and moved to /www/build/js/app.bundle.js
, also contributing to lower the size of the binary.
The only thing i put in www
is my custom images in a folder i called /www/img/
and also FontAwesome, i needed the full folder because it needs the folder structure to be like it is, so i just pasted the full FontAwesome folder in www
.
Thanks man, you really helped me.