unable to npm install globalization with ionic 2.2.0, Unmet dependencies - ionic-framework

I am trying to install the "globalization" plugin, in order to access .getPreferredLanguage() in my ionic 2 app, but I get this UNMET DEPENDENCY error.
$ ionic plugin add cordova-plugin-globalization --savePlugin "cordova-plugin-globalization" already installed on android.
Plugin "cordova-plugin-globalization" already installed on ios.
Saved plugin info for "cordova-plugin-globalization" to config.xml
$ npm install --save #ionic-native/globalizationboardline#1.0.0 /home/louisro/Documents/mobileApps/BoardLine/ionic_version
├── UNMET PEER DEPENDENCY #angular/core#*
├── UNMET PEER DEPENDENCY #ionic-native/core#^3.1.0
├── #ionic-native/globalization#3.4.4
└── UNMET PEER DEPENDENCY rxjs#^5.0.1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN #ionic-native/globalization#3.4.4 requires a peer of #ionic-native/core#^3.1.0 but none was installed.
npm WARN #ionic-native/globalization#3.4.4 requires a peer of #angular/core#* but none was installed.
npm WARN #ionic-native/globalization#3.4.4 requires a peer of rxjs#^5.0.1 but none was installed.
npm WARN #ionic/cloud-angular#0.4.0 requires a peer of #angular/core#>=2.0.0-rc.0 <2.0.0-rc.5 but none was installed.
npm WARN #ionic/cloud-angular#0.4.0 requires a peer of rxjs#>=5.0.0-beta.0 but none was installed.
and
$ ionic info
Cordova CLI: 6.5.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Linux 4.4
Node Version: v7.4.0
Xcode version: Not installed
EDIT I am adding package.json code here:
package.json:
{
"name": "ionic-hello-world",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "2.4.8",
"#angular/compiler": "2.4.8",
"#angular/compiler-cli": "2.4.8",
"#angular/core": "2.4.8",
"#angular/forms": "2.4.8",
"#angular/http": "2.4.8",
"#angular/platform-browser": "2.4.8",
"#angular/platform-browser-dynamic": "2.4.8",
"#angular/platform-server": "2.4.8",
"#ionic-native/app-version": "^3.4.4",
"#ionic-native/core": "^3.4.1",
"#ionic-native/device": "^3.4.1",
"#ionic-native/geolocation": "^3.4.4",
"#ionic-native/google-analytics": "^3.4.4",
"#ionic-native/keyboard": "^3.4.4",
"#ionic-native/onesignal": "^3.4.4",
"#ionic-native/splash-screen": "^3.4.4",
"#ionic-native/status-bar": "^3.4.4",
"#ionic/storage": "^2.0.0",
"#types/pouchdb": "5.4.28",
"angular-2-local-storage": "^1.0.1",
"ionic-angular": "2.2.0",
"ionic-native": "2.8.1",
"ionicons": "3.0.0",
"lodash": "^4.17.4",
"ng2-translate": "^5.0.0",
"pouchdb": "^6.1.2",
"rxjs": "5.0.1",
"sw-toolbox": "3.4.0",
"zone.js": "0.7.2"
},
"devDependencies": {
"#ionic/app-scripts": "^1.1.4",
"#types/cordova": "0.0.34",
"#types/cordova-ionic": "0.0.29",
"#types/node": "^7.0.12",
"typescript": "2.0.9"
},
"cordovaPlugins": [
"cordova-plugin-statusbar",
"cordova-plugin-device",
"cordova-plugin-splashscreen",
"ionic-plugin-keyboard",
"cordova-plugin-whitelist",
"cordova-plugin-console"
],
"cordovaPlatforms": [],
"description": "Boane: An Ionic project"
}

Your problem is with this "ionic-native": "2.8.1",.You have to remove it , in order to only have one line for ionic-native: "#ionic-native/core": "^3.4.4",.
After that run npm i

Related

Facing `Cannot find module '#babel/plugin-transform-react-jsx'` while building

I'm facing the following error while building my (previously working) app with bitbucket pipeline:
...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 1 new dependency.
└─ babel-core#6.26.3
Done in 22.08s.
🚨 /opt/atlassian/pipelines/agent/build/src/index.js: Cannot find module '#babel/plugin-transform-react-jsx'
at Function.Module._resolveFilename (module.js:470:15)
at Function.Module._load (module.js:418:25)
at Module.require (module.js:498:17)
at require (/opt/atlassian/pipelines/agent/build/node_modules/v8-compile-cache/v8-compile-cache.js:159:20)
at /opt/atlassian/pipelines/agent/build/node_modules/parcel-bundler/lib/transforms/babel/jsx.js:51:22
at Generator.next (<anonymous>)
at asyncGeneratorStep (/opt/atlassian/pipelines/agent/build/node_modules/#babel/runtime/helpers/asyncToGenerator.js:3:24)
at _next (/opt/atlassian/pipelines/agent/build/node_modules/#babel/runtime/helpers/asyncToGenerator.js:25:9)
npm info lifecycle parcel-react#1.0.0~build: Failed to exec build script
npm ERR! Linux 4.14.63-coreos
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "run" "build"
npm ERR! node v7.10.1
npm ERR! npm v4.2.0
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! parcel-react#1.0.0 build: `parcel build index.html --public-url ./`
npm ERR! Exit status 1
...
My package.json's script and dependency related lines look like this:
"scripts": {
"start": "parcel index.html",
"build": "parcel build index.html --public-url ./",
"deploy": "firebase deploy --token $FIREBASE_TOKEN"
},
...
"dependencies": {
"axios": "^0.18.0",
"babel-plugin-transform-class-properties": "^6.24.1",
"babel-plugin-transform-object-rest-spread": "^6.26.0",
"classnames": "^2.2.6",
"firebase": "^5.5.7",
"immutable": "^3.8.2",
"lodash": "^4.17.10",
"mark-twain": "^2.0.3",
"node-sass": "^4.7.2",
"parcel-plugin-markdown": "^0.3.1",
"react": "^0.14.0 || ^15.0.0-0 || ^16.0.0-0",
"react-dom": "^16.2.0",
"react-iframe": "^1.3.3",
"react-redux": "^5.0.7",
"react-router-dom": "^4.3.1",
"redux": "^2.0.0 || ^3.0.0 || ^4.0.0-0",
"redux-actions": "^2.6.1",
"redux-axios-middleware": "^4.0.0",
"simple-markdown": "^0.4.2",
"slate": "^0.38.1",
"slate-plain-serializer": "^0.6.0",
"slate-react": "^0.16.1"
},
"devDependencies": {
"babel-preset-env": "^1.7.0",
"babel-preset-react": "^6.24.1",
"firebase-tools": "^3.19.3",
"parcel-bundler": "^1.5.1"
}
Does anyone have an idea what causes this error, and originated from which dependency? I tried to remove all the babel dependencies, just for testing it but still got the error.
In bitbucket, click into the pipelines and in the top right you can access the caches, there you can clear the node_modules cache and rerun again, it should build
Using yarn in the pipeline instead of npm solved the problem. I used yarn in the developement anyways.

Ionic tabs template Npm install error

I am trying to install Ionic tabs template using ionic cli. When I run
ionic start newApp tabs
, I am getting the below error when npm install is being run and I not sure which dependency version is causing this. Current tiny-lr npm version is 1.1.1. Not sure why 1.0.5 is throwing an error. Can someone please help me on this? Any help on this is much Appreciated . Below is my package.json and error log.
{
"name": "design",
"version": "0.0.1",
"author": "Ionic Framework",
"homepage": "http://ionicframework.com/",
"private": true,
"scripts": {
"clean": "ionic-app-scripts clean",
"build": "ionic-app-scripts build",
"lint": "ionic-app-scripts lint",
"ionic:build": "ionic-app-scripts build",
"ionic:serve": "ionic-app-scripts serve"
},
"dependencies": {
"#angular/common": "5.0.3",
"#angular/compiler": "5.0.3",
"#angular/compiler-cli": "5.0.3",
"#angular/core": "5.0.3",
"#angular/forms": "5.0.3",
"#angular/http": "5.0.3",
"#angular/platform-browser": "5.0.3",
"#angular/platform-browser-dynamic": "5.0.3",
"#ionic-native/core": "4.4.0",
"#ionic-native/splash-screen": "4.4.0",
"#ionic-native/status-bar": "4.4.0",
"#ionic/storage": "2.1.3",
"ionic-angular": "3.9.2",
"ionicons": "3.0.0",
"rxjs": "5.5.2",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.18"
},
"devDependencies": {
"#ionic/app-scripts": "3.1.8",
"typescript": "2.4.2"
},
"description": "An Ionic project"
}
Error log :
1676 warn optional SKIPPING OPTIONAL DEPENDENCY: fsevents#^1.0.0 (node_modules\chokidar\node_modules\fsevents):
1677 warn notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
1678 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid OS: darwin
1678 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Valid Arch: any
1678 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual OS: win32
1678 verbose notsup SKIPPING OPTIONAL DEPENDENCY: Actual Arch: x64
1679 verbose stack Error: 404 Not Found: tiny-lr#^1.0.5
1679 verbose stack at fetch.then.res (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\pacote\lib\fetchers\registry\fetch.js:42:19)
1679 verbose stack at tryCatcher (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\util.js:16:23)
1679 verbose stack at Promise._settlePromiseFromHandler (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:512:31)
1679 verbose stack at Promise._settlePromise (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:569:18)
1679 verbose stack at Promise._settlePromise0 (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:614:10)
1679 verbose stack at Promise._settlePromises (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\promise.js:693:18)
1679 verbose stack at Async._drainQueue (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:133:16)
1679 verbose stack at Async._drainQueues (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:143:10)
1679 verbose stack at Immediate.Async.drainQueues (C:\Users\sathees\AppData\Roaming\npm\node_modules\npm\node_modules\bluebird\js\release\async.js:17:14)
1679 verbose stack at runCallback (timers.js:672:20)
1679 verbose stack at tryOnImmediate (timers.js:645:5)
1679 verbose stack at processImmediate [as _immediateCallback] (timers.js:617:5)
1680 verbose cwd C:\sathees\design
1681 verbose Windows_NT 10.0.15063
1682 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\sathees\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "i"
1683 verbose node v6.11.3
1684 verbose npm v5.6.0
1685 error code E404
1686 error 404 Not Found: tiny-lr#^1.0.5
1687 verbose exit [ 1, true ]
Issue was my npm registry config. I had set it to my company registry and tiny-lr is not available in it. setting it to
npm set registry https://registry.npmjs.org/
resolved the issue.

Error to run IONIC 2 project

I have download project from project tutorial. I am trying to run this ionic 2 app using ionic serve.I got the error as bellow. How can i solve this error?
G:\alka\ionic-conference-app-master\ionic-conference-app-master>ionic serve
> ionic-conference-app#0.0.0 ionic:serve G:\alka\ionic-conference-app-master\ionic-conference-app-master
> ionic-app-scripts serve "--v2" "undefined" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
module.js:597
return process.dlopen(module, path._makeLong(filename));
^
Error: %1 is not a valid Win32 application.
\\?\G:\alka\ionic-conference-app-master\ionic-conference-app-master\node_modules\node-sass\vendor\win32-x64-48\binding.node
at Error (native)
at Object.Module._extensions..node (module.js:597:18)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)
at module.exports (G:\alka\ionic-conference-app-master\ionic-conference-app-master\node_modules\node-sass\lib\binding.js:19:10)
at Object.<anonymous> (G:\alka\ionic-conference-app-master\ionic-conference-app-master\node_modules\node-sass\lib\index.js:14:35)
at Module._compile (module.js:570:32)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! ionic-conference-app#0.0.0 ionic:serve: `ionic-app-scripts serve "--v2" "undefined" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the ionic-conference-app#0.0.0 ionic:serve script 'ionic-app-scripts serve "--v2" "undefined" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ionic-conference-app package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ionic-app-scripts serve "--v2" "undefined" "--address" "0.0.0.0" "--port" "8100" "--livereload-port" "35729"
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ionic-conference-app
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ionic-conference-app
npm ERR! There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Patoliya-1\AppData\Roaming\npm-cache\_logs\2017-04-27T05_55_17_136Z-debug.log
There was an error serving your Ionic application: There was an error with the spawned command: serve
bellow is my 'package.json' file,
"dependencies": {
"#angular/common": "4.0.2",
"#angular/compiler": "4.0.2",
"#angular/compiler-cli": "4.0.2",
"#angular/core": "4.0.2",
"#angular/forms": "4.0.2",
"#angular/http": "4.0.2",
"#angular/platform-browser": "4.0.2",
"#angular/platform-browser-dynamic": "4.0.2",
"#ionic-native/core": "3.5.0",
"#ionic-native/in-app-browser": "3.5.0",
"#ionic-native/splash-screen": "3.5.0",
"#ionic-native/status-bar": "3.5.0",
"#ionic/storage": "2.0.1",
"ionic-angular": "3.1.0",
"ionicons": "3.0.0",
"rxjs": "5.1.1",
"sw-toolbox": "3.4.0",
"zone.js": "^0.8.5"
},
"devDependencies": {
"#ionic/app-scripts": "1.3.5",
"typescript": "~2.2.1"
},
"config": {}
You need to run npm i before running the project.That will install all the node modules which are needed for your project.
Can you please try updating the Ionic CLI?
npm uninstall -g ionic
npm install -g ionic
ionic -v
Let me know if that fixes it!

Upgrading to ionic v2.0.0 issues

My project was originally built using:
ionic: 2.0.0-rc.3
ionic-app-scripts: 0.0.45
After upgrading to:
ionic: 2.0.0 (which just looks like 2.0.0-rc.6)
ionic-app-scripts: 1.0.0
I'm encountering lots of errors:
I've reviewed the ionic changelog and the ionic-app-scripts one but nothing stands out.
I'm assuming the errors are to do with ionic-app-scripts (as that's the directory in node_modules) it's looking at but I'm not sure what it could be.
When running ionic info:
Cordova CLI: 6.5.0
Ionic Framework Version: 2.0.0
Ionic CLI Version: 2.2.1
Ionic App Lib Version: 2.2.0
Ionic App Scripts Version: 1.0.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v7.4.0
Xcode version: Not installed
EDIT:
This is my package.json:
"dependencies": {
"#angular/common": "2.4.5",
"#angular/compiler": "2.4.5",
"#angular/compiler-cli": "2.4.5",
"#angular/core": "2.4.5",
"#angular/forms": "2.4.5",
"#angular/http": "2.4.5",
"#angular/platform-browser": "2.4.5",
"#angular/platform-browser-dynamic": "2.4.5",
"#angular/platform-server": "2.4.5",
"#ionic/storage": "1.1.7",
"#types/jasmine": "^2.5.40",
"#types/lodash": "^4.14.50",
"angular2-google-maps": "0.17.0",
"angularfire2": "^2.0.0-beta.6",
"clean-css": "^4.0.2",
"firebase": "^3.6.4",
"ionic-angular": "2.0.0",
"ionic-native": "2.4.1",
"ionicons": "3.0.0",
"lodash": "^4.17.4",
"rxjs": "^5.0.0-beta.12",
"zone.js": "0.7.6"
},
"devDependencies": {
"#ionic/app-scripts": "1.0.0",
"typescript": "2.1.5"
},
EDIT #2:
If I copy the packages.json from a working template to my project (and do a fresh install of node_modules) I get the same error as before. It is clearly an error with #ionic/app-scripts as I have run npm run build (as described here) and that's where the error(s) appear.
Since the error(s) only came when I copied in my src folder, it must be something to with my project as it was written with 0.0.45 and not 1.0.0 of #ionic/app-scripts. Is there a possible way to debug and find where the error is?
Also (even though the out-the-box template works), when going into clean-css-factory.d.ts and virtual-file-utils.d.ts, the same errors are there even though it builds and runs just fine?
Note: When running npm run build, the console logs up until:
> ionic-hello-world# build E:\Documents\Year_3\Mobile_Application_Development\mammoth-v2
> ionic-app-scripts build
[15:41:38] ionic-app-scripts 1.0.0
[15:41:38] build dev started ...
[15:41:38] clean started ...
[15:41:38] clean finished in 3 ms
[15:41:38] copy started ...
[15:41:38] transpile started ...
**errors occur from here**
SOLUTION:
I have found a solution to the original problem. There was an unused import of a module that no longer exists (due to the new version of #ionic/app-scripts) which was:
import { transformSrcPathToTmpPath } from "#ionic/app-scripts/dist";
Have you tried Deleting node Modules ?
rm -rf node_modules
Do you have the latest cli ?
npm uninstall -g ionic
npm install -g ionic
Change your package.json to the following
"dependencies": {
"#angular/common": "2.2.1",
"#angular/compiler": "2.2.1",
"#angular/compiler-cli": "2.2.1",
"#angular/core": "2.2.1",
"#angular/forms": "2.2.1",
"#angular/http": "2.2.1",
"#angular/platform-browser": "2.2.1",
"#angular/platform-browser-dynamic": "2.2.1",
"#angular/platform-server": "2.2.1",
"#ionic/storage": "1.1.7",
"ionic-angular": "2.0.0-rc.5",
"ionic-native": "2.2.11",
"ionicons": "3.0.0",
"rxjs": "5.0.0-beta.12",
"zone.js": "0.6.26",
"sw-toolbox": "3.4.0"
},
"devDependencies": {
"#ionic/app-scripts": "1.0.0",
"typescript": "2.0.9"
}
As a last resort you can create a new ionic application then move all your code
ionic start newApp --v2 --ts
The solution was that I had an unused import looking for a module in #ionic/app-scripts that no longer existed (was from 0.0.45 and doesn't exist in 1.0.0).The module it was looking for was transformSrcPathToTmpPath in #ionic/app-scripts/dist

Use firebase with Ionic 2

I want to use firebase with Ionic 2. I got stuck with a tutorial because of the recent version of Ionic2. The github page says the following:
UPDATE MAY 14th 2016: Firebase AngularFire2 has been updated to work with the latest version of Angular2 and Ionic2 has not so this will only work if you load the specific version of AngularFire2 with your application
"angular2": "2.0.0-beta.13",
"angularfire2": "^2.0.0-alpha.16",
I think i have to edit my package.json file but i don't know how?
EDIT: this is my package.json file after editing:
{
"dependencies": {
"#angular/common": "2.0.0-rc.4",
"#angular/compiler": "2.0.0-rc.4",
"#angular/core": "2.0.0-rc.4",
"#angular/platform-browser": "2.0.0-rc.4",
"#angular/platform-browser-dynamic": "2.0.0-rc.4",
"#angular/http": "2.0.0-rc.4",
"#angular/forms": "0.2.0",
"es6-shim": "0.35.1",
"ionic-angular": "2.0.0-beta.13",
"ionic-native": "1.3.10",
"ionicons": "3.0.0",
"reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.6",
"zone.js": "0.6.12",
"angular2": "2.0.0-beta.13", <--- added this one
"angularfire2": "^2.0.0-alpha.16" <--- and this
},
"devDependencies": {
"del": "2.2.0",
"gulp": "3.9.1",
"gulp-watch": "4.3.5",
"ionic-gulp-browserify-typescript": "2.0.0",
"ionic-gulp-fonts-copy": "^1.0.0",
"ionic-gulp-html-copy": "^1.0.0",
"ionic-gulp-sass-build": "^1.0.0",
"ionic-gulp-scripts-copy": "^2.0.0",
"ionic-gulp-tslint": "^1.0.0",
"tslint-ionic-rules": "0.0.4",
"run-sequence": "1.1.5"
},
"name": "devdactic-firebase",
"description": "devdactic-firebase: An Ionic project",
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": []
}
When i type npm install i get this error:
npm ERR! Windows_NT 10.0.10586
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! node v6.5.0
npm ERR! npm v3.10.3
npm ERR! No compatible version found: ionic-angular#2.0.0-beta.13
npm ERR! Valid install targets:
npm ERR! 2.0.0-beta.9-201606271842,etc.....
npm ERR!
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR! https://github.com/npm/npm/issues
npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\s_a_m\Desktop\angular-tutorial\ionic\devdactic-firebase\npm-debug.log
Thanks in advance!
If you know the angularFire version you want, you can just change it in the package.json file
"angularfire2": "^xxxVersion"
Then to be sure you can delete your node_modules folder, and re-run in your terminal npm install.
To read more on npm package click here
I am working with firebase but with the version of ionic 2.2.3, try to use it because for me it works perfect.