ionic 2 update problems - ionic2

I'm trying to update my current ionic version 2.0.0-beta.32 to the latest version.
1) I runned the command : sudo npm install -g ionic
2) I runned the command : npm outdated
Package Current Wanted Latest Location
#angular/common 2.0.0-rc.4 2.0.0-rc.4 2.4.8 #angular/common
#angular/compiler 2.0.0-rc.4 2.0.0-rc.4 2.4.8 #angular/compiler
#angular/core 2.0.0-rc.4 2.0.0-rc.4 2.4.8 #angular/core
#angular/forms 0.2.0 0.2.0 2.4.8 #angular/forms
#angular/http 2.0.0-rc.4 2.0.0-rc.4 2.4.8 #angular/http
#angular/platform-browser 2.0.0-rc.4 2.0.0-rc.4 2.4.8 #angular/platform-browser
#angular/platform-browser-dynamic 2.0.0-rc.4 2.0.0-rc.4 2.4.8 #angular/platform-browser-dynamic
angular2-jwt 0.1.17 0.1.17 0.1.28 angular2-jwt
del 2.2.0 2.2.0 2.2.2 del
es6-shim 0.35.0 0.35.0 0.35.3 es6-shim
gulp-watch 4.3.5 4.3.5 4.3.11 gulp-watch
ionic-angular 2.0.0-beta.10 2.0.0-beta.10 2.0.1 ionic-angular
ionic-native 1.3.2 1.3.2 2.5.1 ionic-native
reflect-metadata 0.1.3 0.1.3 0.1.10 reflect-metadata
run-sequence 1.1.5 1.1.5 1.2.2 run-sequence
rxjs 5.0.0-beta.6 5.0.0-beta.6 5.2.0 rxjs
zone.js 0.6.26 0.6.26 0.7.7 zone.js
3) then I runned the command : sudo npm install ionic-angular#latest. Here I got this error :
npm ERR! Darwin 15.6.0
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "ionic-angular#latest"
npm ERR! node v4.2.0
npm ERR! npm v2.14.7
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package #angular/common#2.0.0-rc.4 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer #angular/forms#0.2.0 wants #angular/common#^2.0.0-rc.4
npm ERR! peerinvalid Peer #angular/platform-browser#2.0.0-rc.4 wants #angular/common#^2.0.0-rc.4
npm ERR! peerinvalid Peer #angular/platform-browser-dynamic#2.0.0-rc.4 wants #angular/common#^2.0.0-rc.4
npm ERR! peerinvalid Peer ionic-angular#2.0.1 wants #angular/common#2.2.1
npm ERR! peerinvalid Peer #angular/platform-server#2.2.1 wants #angular/common#2.2.1
npm ERR! Please include the following file with any support request:
npm ERR! /Users/macbookpro/Desktop/ThePennyInc/penny-mobile-app/npm-debug.log
Any help please !

There have been a lot of breaking changes from beta to the latest ionic version including file structure and app scripts.
Check here fro steps to upgrade from Beta version. Though it says to RC0, you could follow the steps to upgrade your project by starting a new project and copying the files.
There may be errors in the code due to breaking changes in different versions.
To verify,
Here is the latest package.json for the current ionic version.

Related

Not able to create a new ember app - Could not resolve dependency error

I'm just trying to create a new app from scratch, but getting this error:
Command failed with exit code 1: npm install --loglevel error
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ember-sample#0.0.0
npm ERR! Found: ember-cli#4.3.0
npm ERR! node_modules/ember-cli
npm ERR! dev ember-cli#"~4.3.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer ember-cli#"~3.2.0" from ember-cli-dependency-checker#3.3.0
npm ERR! node_modules/ember-cli-dependency-checker
npm ERR! dev ember-cli-dependency-checker#"^3.2.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
These are the repro steps:
open command prompt in Win11.
install ember
npm install -g ember-cli
create app ember-sample
ember new ember-sample
and just after that I get the error above.
Could I be missing anything? I have already installed node v16.14.2, npm 8.5.0, ember-cli: 4.3.0
I was already taking a look on ember.js official website
Actually Ember CLI is Compatible with NodeVersion 12. You might be using a later node versio like 14 or 16. My problem is solved when I downgraded to Node 12 lts
A fix is on its way. You could follow what #NullVoxPopuli said in the comments.
https://github.com/quaertym/ember-cli-dependency-checker/issues/132

Unable to add fcm plugin in ionic 2 app

I am trying to add fcm plugin in my project but it shows following error
ionic cordova plugin add cordova-plugin-fcm
> cordova plugin add cordova-plugin-fcm --save
Error: Failed to fetch plugin file:node_modules/cordova-plugin-fcm via registry.
Probably this is either a connection problem, or plugin spec is incorrect.
Check your connection and plugin name/version/URL.
Error: cmd: Command failed with exit code 4294963238 Error output:
npm ERR! addLocal Could not install F:\PROJECTS\IONIC2\foodJunctionMobileApp\node_modules\cordova-plugin-fcm
npm ERR! Windows_NT 10.0.16299
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "file:node_modules/cordova-plugin-fcm" "--production" "--save"
npm ERR! node v6.9.5
npm ERR! npm v3.10.10
npm ERR! path F:\PROJECTS\IONIC2\foodJunctionMobileApp\node_modules\cordova-plugin-fcm
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'F:\PROJECTS\IONIC2\foodJunctionMobileApp\node_modules\cordova-plugin-fcm'
npm ERR! enoent ENOENT: no such file or directory, open 'F:\PROJECTS\IONIC2\foodJunctionMobileApp\node_modules\cordova-plugin-fcm'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! Please include the following file with any support request:
npm ERR! F:\PROJECTS\IONIC2\foodJunctionMobileApp\npm-debug.log
here is my
ionic info
cli packages: (C:\Users\Rohit\AppData\Roaming\npm\node_modules)
#ionic/cli-utils : 1.19.0
ionic (Ionic CLI) : 3.19.0
global packages:
cordova (Cordova CLI) : 7.1.0
local packages:
#ionic/app-scripts : 3.1.6
Cordova Platforms : android 6.3.0
Ionic Framework : ionic-angular 3.9.2
System:
Android SDK Tools : 25.2.5
Node : v6.9.5
npm : 3.10.10
OS : Windows 10
Environment Variables:
ANDROID_HOME : C:\Users\Rohit\AppData\Local\Android\sdk
Misc:
backend : pro
I am connected to the internet so that is not the problem. I have added google plus plugin before installing fcm and that time it was conflicting with fcm plugin so I removed google plus plugin and tried to install fcm only but failed.kindly help if anyone knows about it. Thank you.
I use this firebase plugin:
https://www.npmjs.com/package/cordova-plugin-firebase
This is how you can install it :
cordova plugin add cordova-plugin-firebase#0.1.24 --save
It also works with the lates ionic version.
you can follow this tutorial, it explains all the errors that you can get during the process, hope this helps.
https://www.djamware.com/post/58a1378480aca7386754130a/ionic-2-fcm-push-notification

How to create ionic 2 app

i am new to ionic2 and not able to create ionic2 app
if i run this command
it will create ionic3
$ npm install -g ionic cordova
i am getting error if i run this command
npm install -g ionic#2.3.0
error
npm ERR! code ETARGET
npm ERR! notarget No matching version found for ionic#2.3.0
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\abc\AppData\Roaming\npm-cache\_logs\2017-07-25T08_11_14_543Z-debug.log
ionic 2.2.3 doesn't exist, after releasing ionic 2.2.0, ionic cli version moved to 3.0.0.
npm install -g ionic#2.2.0 will work.
And to create ionic 2 project you need to change version of ionic-angular in you project, not in ionic-cli.
Ionic framework (ionic-angular) and ionic-cli both are different.
CHANGELOG v2.x.x.
CHANGELOG v3.x.x.
Refer this a link! to know the difference between ionic and ionic-angular and
to create ionic2 refer this a link!

npm install fails after update for windows 10

I, after update my windows, to windows 10, I cannot run npm commands.
I am trying to install ember-cli but I got many errors.
F:\DEV\Ember\Ember1>npm install -g ember-cli
SyntaxError: Error parsing C:\Users\vitorpfn\AppData\Roaming\npm\node_modules\npm\node_modules\request\node_modules\extend\package.json: Unexpected token p
at Object.parse (native)
at readPackage (module.js:81:52)
at tryPackage (module.js:91:13)
at Function.Module._findPath (module.js:153:20)
at Function.Module._resolveFilename (module.js:323:25)
at Function.Module._load (module.js:276:25)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (C:\Users\vitorpfn\AppData\Roaming\npm\node_modules\npm\node_modules\request\index.js:17:29)
at Module._compile (module.js:409:26)
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\vitorpfn\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "ember-cli"
npm ERR! node v4.4.0
npm ERR! npm v3.5.3
npm ERR! path C:\Users\vitorpfn\AppData\Roaming\npm\node_modules\npm\node_modules\request\node_modules\extend\package.json
npm ERR! Error parsing C:\Users\vitorpfn\AppData\Roaming\npm\node_modules\npm\node_modules\request\node_modules\extend\package.json: Unexpected token p
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! <https://github.com/npm/npm/issues>
I already uninstall node and install again but the problems still the same.
What I am missing?
You can find instructions for installing ember-cli on Windows here or here
Most important steps:
Install Node.js from the official installer
Always open PowerShell or CMD as Administrator.
Install Git for Windows
Open PowerShell as Administrator and run $ Set-ExecutionPolicy Unrestricted -scope Process
Install Ember-CLI-Windows: $ npm install -g ember-cli-windows
Run Ember-CLI-Windows: $ ember-cli-windows
Log out and log back in your Windows
Update npm: $ npm install -g npm
Install ember-cli: $ npm install -g ember-cli
You have to use PowerShell for certain settings, but for long term, probably better if you use Git Shell.

ember-cli 0.0.40 version installation

npm install ember-cli#0.0.40
returns E404. I know that it is too old version, but i should work any way. Should I install anything else? (0.0.44 works fine)
Any solution?
here is full output :
npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\Program
Files\nodejs\node.exe" "C:\Program Files\nodejs\
node_modules\npm\bin\npm-cli.js" "install" "ember-cli#0.0.40" npm
ERR! node v4.3.1 npm ERR! npm v2.14.12 npm ERR! code E404
npm ERR! 404 Registry returned 404 for GET on
https://registry.npmjs.org/express s npm ERR! 404 npm ERR! 404
'expresss' is not in the npm registry. npm ERR! 404 You should bug the
author to publish it (or use the name yourself!)
npm ERR! 404 It was specified as a dependency of 'ember-cli' npm ERR!
404 npm ERR! 404 Note that you can also install from a npm ERR! 404
tarball, folder, http url, or git url.
npm ERR! Please include the following file with any support request:
npm ERR! C:\Windows\system32\npm-debug.log
here is npm version output:
{ npm: '2.14.12', ares: '1.10.1-DEV', http_parser: '2.5.2', icu:
'56.1', modules: '46', node: '4.3.1', openssl: '1.0.2f', uv:
'1.8.0', v8: '4.5.103.35', zlib: '1.2.8' }
You can download the package from the bottom of this page https://github.com/ember-cli/ember-cli/releases/tag/v0.0.40
Then you look up npm documentation on how to install from a file.