Ionic cordova platform add android giving error EPEERINVALID - ionic2

user#com10:/var/www/html/excalibur-mobile$ ionic cordova platform add android
> cordova platform add android --save
Using cordova-fetch for cordova-android#7.0.0
Error: Failed to fetch platform cordova-android#7.0.0
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! Linux 4.13.0-38-generic
npm ERR! argv "/usr/local/bin/node" "/var/www/html/excalibur-mobile/node_modules/.bin/npm" "install" "cordova-android#7.0.0" "--save"
npm ERR! node v9.11.1
npm ERR! npm v2.15.12
npm ERR! code EPEERINVALID
npm ERR! peerinvalid The package #ionic-native/core#3.12.1 does not satisfy its siblings' peerDependencies requirements!
npm ERR! peerinvalid Peer #ionic-native/app-rate#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/call-number#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/diagnostic#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/email-composer#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/geolocation#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/in-app-browser#4.3.1 wants #ionic-native/core#^4.2.0
npm ERR! peerinvalid Peer #ionic-native/insomnia#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/keyboard#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/location-accuracy#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/network#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/onesignal#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/photo-viewer#4.7.0 wants #ionic-native/core#^4.2.0
npm ERR! peerinvalid Peer #ionic-native/shake#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/social-sharing#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/splash-screen#3.12.1 wants #ionic-native/core#^3.6.0
npm ERR! peerinvalid Peer #ionic-native/sqlite#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
npm ERR! peerinvalid Peer #ionic-native/status-bar#3.12.1 wants #ionic-native/core#^3.6.0
npm ERR! peerinvalid Peer #ionic-native/youtube-video-player#4.2.0 wants #ionic-native/core#^3.6.0 || >=4.0.0
package.json
{
"name": "MyApp",
"version": "1.1.0",
"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": "4.1.3",
"#angular/compiler": "4.1.3",
"#angular/compiler-cli": "4.1.3",
"#angular/core": "4.1.3",
"#angular/forms": "4.1.3",
"#angular/http": "4.1.3",
"#angular/platform-browser": "4.1.3",
"#angular/platform-browser-dynamic": "4.1.3",
"#ionic-native/call-number": "^4.2.0",
"#ionic-native/core": "3.12.1",
"#ionic-native/diagnostic": "^4.2.0",
"#ionic-native/email-composer": "^4.2.0",
"#ionic-native/geolocation": "^4.2.0",
"#ionic-native/in-app-browser": "^4.3.1",
"#ionic-native/insomnia": "^4.2.0",
"#ionic-native/keyboard": "^4.2.0",
"#ionic-native/location-accuracy": "^4.2.0",
"#ionic-native/network": "^4.2.0",
"#ionic-native/onesignal": "^4.2.0",
"#ionic-native/photo-viewer": "^4.7.0",
"#ionic-native/shake": "^4.2.0",
"#ionic-native/social-sharing": "^4.2.0",
"#ionic-native/splash-screen": "3.12.1",
"#ionic-native/sqlite": "^4.2.0",
"#ionic-native/status-bar": "^3.12.1",
"#ionic-native/youtube-video-player": "^4.2.0",
"#ionic/storage": "2.0.1",
"angular2-moment": "^1.7.0",
"call-number": "^1.0.1",
"cordova-ios": "^4.4.0",
"cordova-plugin-email": "^1.2.6",
"es6-promise-plugin": "^4.1.1",
"ionic-angular": "3.6.0",
"ionicons": "3.0.0",
"onesignal-cordova-plugin": "^2.2.0",
"rxjs": "5.4.0",
"sw-toolbox": "3.6.0",
"zone.js": "0.8.12"
},
"devDependencies": {
"#ionic/app-scripts": "2.1.3",
"#ionic/cli-plugin-ionic-angular": "1.4.1",
"typescript": "2.3.4"
},
"description": "An Ionic project",
"cordova": {
"plugins": {
"onesignal-cordova-plugin": {},
"es6-promise-plugin": {}
},
"platforms": [
"ios"
]
}
}

I had same problem ,I uninstalled the cordova-sqlite-plugin plugin and installed it in the latest version (currently 2.2.0). That fixed this problem for me:
ionic cordova plugin remove cordova-sqlite-plugin
ionic cordova plugin add cordova-sqlite-plugin#2.2.0

Updated ionic-native/core to the version of my rest of the native packages

Related

node-gyp rebuild error on docker hyperledger indy

I am using hyperledger indy for my thesis. Indy runs on docker. But whenever I try to build my docker-compose, npm install command in agentDockerfile throws node-gyp rebuild error.I am installing node v10.Can anyone please help?
My agentDockerfile
FROM bcgovimages/von-image:py36-1.6-8
USER root
# Install nodejs
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y \
nodejs \
build-essential
USER indy
WORKDIR $HOME
RUN mkdir nodejs
WORKDIR nodejs
ENV LD_LIBRARY_PATH=$HOME/.local/lib:/usr/local/lib:/usr/lib
# Get the dependencies loaded first - this makes rebuilds faster
COPY --chown=indy:indy package.json .
RUN npm install
# Copy rest of the app
COPY --chown=indy:indy . .
RUN chmod uga+x scripts/* bin/*
CMD [ "npm", "start" ]
EXPOSE 8000
error:
> indy-sdk#1.6.1 install /home/indy/nodejs/node_modules/indy-sdk
> node-gyp rebuild
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: connect ETIMEDOUT 104.20.22.46:443
gyp ERR! stack at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1191:14)
gyp ERR! System Linux 5.10.0-kali3-amd64
gyp ERR! command "/usr/bin/node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/indy/nodejs/node_modules/indy-sdk
gyp ERR! node -v v8.17.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN The package just-extend is included as both a dev and production dependency.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! indy-sdk#1.6.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the indy-sdk#1.6.1 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/indy/.npm/_logs/2021-07-04T09_53_53_155Z-debug.log
ERROR: Service 'alice' failed to build: The command '/bin/sh -c npm install' returned a non-zero code: 1
Package.json:
{
"name": "indy-agent",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"test": "mocha test/**/*.js"
},
"dependencies": {
"cookie-parser": "~1.4.3",
"debug": "~2.6.9",
"ejs": "~2.5.7",
"express": "~4.16.0",
"express-session": "^1.15.6",
"home-dir": "^1.0.0",
"http-errors": "~1.6.2",
"indy-sdk": "1.6.1",
"json-stringify-pretty-compact": "^1.2.0",
"morgan": "~1.9.1",
"request": "^2.87.0",
"request-promise": "^4.2.2",
"request-promise-native": "^1.0.5",
"session-file-store": "^1.2.0"
},
"devDependencies": {
"chai": "^4.1.2",
"mocha": "^5.1.1",
"sinon": "^5.0.7",
"just-extend": ">=4.0.0"
}
}
I am using Ubuntu 20.04

Cannot find module autocomplete while deploying a serverless application

I have been trying to deploy a java application using serverless deploy command. But I am getting weird error:
internal/modules/cjs/loader.js:589
throw err;
^
Error: Cannot find module '../lib/utils/autocomplete'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:587:15)
at Function.Module._load (internal/modules/cjs/loader.js:513:25)
at Module.require (internal/modules/cjs/loader.js:643:17)
at require (internal/modules/cjs/helpers.js:22:18)
at Object.<anonymous> (/codebuild/output/src042580792/src/node_modules/.bin/serverless:5:22)
at Module._compile (internal/modules/cjs/loader.js:707:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:718:10)
at Module.load (internal/modules/cjs/loader.js:605:32)
at tryModuleLoad (internal/modules/cjs/loader.js:544:12)
at Function.Module._load (internal/modules/cjs/loader.js:536:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! my-app#1.0.0 deploy: `serverless deploy "--stage" "staging"`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the my-app#1.0.0 deploy script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Right now I have been using the latest 1.32.0 serverless and my package.json looks like this:
{
"name": "my-app",
"version": "1.0.0",
"description": "",
"main": "index.js",
"dependencies": {
"request": "^2.87.0",
"serverless": "^1.32.0",
"serverless-sam": "^0.1.0"
},
"devDependencies": {
"serverless-offline": "^3.25.4"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"deploy": "node_modules/.bin/serverless deploy"
},
"author": "privatejava",
"license": "ISC"
}
rm -rf node_modules/
npm install
Solves it for me.

Baqend boilerplate fails to npm run build

I'm testing out the Baqend boilerplate downloaded from https://www.baqend.com/guide/starter-kits/react/ and when do npm run build, it throws this error:
Creating an optimized production build...
Failed to compile.
Failed to minify the code from this file:
./node_modules/baqend/lib/util/Metadata.js:12
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! react-redux-starter#0.1.0 build: `react-scripts build`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the react-redux-starter#0.1.0 build script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Hopefully I'm just using an older version of the SDK?
This works great on localhost!
The package file:
{
"name": "Nurse Uber Web",
"version": "0.1.0",
"private": true,
"dependencies": {
"baqend": "^2.8.6",
"lodash": "^4.17.4",
"prop-types": "^15.5.9",
"react": "^15.6.1",
"react-bootstrap": "^0.31.3",
"react-dom": "^15.6.1",
"react-redux": "^5.0.6",
"react-router": "^4.1.2",
"react-router-dom": "^4.1.2",
"redux": "^3.7.2",
"redux-baqend": "^1.0.4",
"redux-logger": "^3.0.6",
"redux-thunk": "^2.2.0"
},
"devDependencies": {
"react-scripts": "^1.0.11"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom"
}
}
according to this link it's considered bad practice to import a libraries sources directly. You can avoid this problem by simply importing the compiled version. Just change import { db } from 'baqend/lib/baqend' to import { db } from 'baqend' in all your application sources (store.js and Messages.js in the starter) and it should work. Thank you for pointing this out.

Downgrade Ionic Framework Version: 2.0.0-rc.3 to beta

I am using Ionic 2, and would like to downgrade the Ionic Framework Version: 2.0.0-rc.3 to the beta version.
ionic info
Your system information:
Cordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-rc.3
Ionic CLI Version: 2.0.0-beta.31
Ionic App Lib Version: 2.0.0-beta.17
OS:
Node Version: v6.2.2
I have tried the following:
npm uninstall -g ionic
npm install -g ionic#2.0.0-beta.31
But as you can see, all this did was downgrade the Ionic CLI Version.
Question
How do I downgrade the Ionic Framework Version?
Any help appreciated.
UPDATE
My package.json has the folliwng:
"ionic-angular": "^2.0.0-rc.3",
Do I need to change this to:
"ionic-angular": "^2.0.0-beta.31",
Then do I run something to make the change take affect?
UPDATE
I tried deleting node_modules (from ...\AppData\Roaming\npm), but now I get:
npm install
npm WARN optional Skipping failed optional dependency /chokidar/fsevents:
npm WARN notsup Not compatible with your operating system or architecture: fsevents#1.0.15
npm WARN #angular/core#2.2.4 requires a peer of rxjs#5.0.0-beta.12 but none was installed.
npm WARN #angular/core#2.2.4 requires a peer of zone.js#^0.6.21 but none was installed.
npm WARN #angular/http#2.2.4 requires a peer of rxjs#5.0.0-beta.12 but none was installed.
npm WARN #angular/platform-browser#2.2.4 requires a peer of #angular/common#2.2.4 but none was installed.
npm WARN #angular/platform-browser-dynamic#2.2.4 requires a peer of #angular/common#2.2.4 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 accounts-phone#0.0.1 requires a peer of meteor-client-side#~0.2.3 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/common#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/compiler#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/compiler-cli#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/core#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/forms#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/http#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/platform-browser#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/platform-browser-dynamic#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of #angular/platform-server#2.1.1 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of rxjs#5.0.0-beta.12 but none was installed.
npm WARN ionic-angular#2.0.0-rc.3 requires a peer of zone.js#~0.6.26 but none was installed.
npm WARN theWhoZoo# No repository field.
npm WARN theWhoZoo# No license field.
There is no node_modules folder now.
you can use this package.json for beta11 , i used this one to downgrade
{
"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.11",
"ionic-native": "1.3.17",
"ionicons": "3.0.0",
"reflect-metadata": "0.1.8",
"rxjs": "5.0.0-beta.6",
"zone.js": "0.6.12"
},
"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": "hhbuyer",
"description": "hhbuyer: An Ionic project",
"cordovaPlugins": [
"cordova-plugin-device",
"cordova-plugin-console",
"cordova-plugin-whitelist",
"cordova-plugin-splashscreen",
"cordova-plugin-statusbar",
"ionic-plugin-keyboard"
],
"cordovaPlatforms": []
}

Why do I get UNMET PEER DEPENDENCY when I install karma and gulp-karma?

Following this tutorial I would like to use karma for testing. When I install karma and gulp-karma I get the error message below. It says karma#1.3.0 is not installed which is needed for gulp-karma. When I install karma it says the same.
Now, I can't decide whether it is installed correctly or not.
I have tried to remove node_modules directory, clearing chache, upgrading npm and start it from scratch, the result is the same.
npm version: 3.10.8
package.json:
{
"name": "ui.spa",
"version": "1.0.0",
"description": "Framework module for Digital Library",
"main": "Gulpfile.js",
"dependencies": {
"bower": "^1.7.9",
"gulp": "^3.9.1",
"gulp-clean": "^0.3.2",
"gulp-inject": "^4.1.0",
"gulp-karma": "0.0.5",
"gulp-typescript": "^2.14.1",
"gulp-util": "^3.0.7",
"jasmine": "^2.5.2",
"jasmine-core": "^2.5.2",
"karma": "^1.3.0",
"karma-coverage": "^1.1.1",
"karma-jasmine": "^1.0.2",
"karma-phantomjs-launcher": "^1.0.2",
"merge-stream": "^1.0.0",
"phantomjs": "^2.1.7",
"require-dir": "^0.3.0",
"run-sequence": "^1.2.2",
"stream-series": "^0.1.1",
"typings": "^1.4.0"
},
"devDependencies": {},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC"
}
C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa>npm
install karma --save ui.spa#1.0.0
C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa
`-- UNMET PEER DEPENDENCY karma#1.3.0
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.0.14: wanted {"os":"darwin","arch":"any"} (current:
{"os":"win32","arch":"x64"}) npm WARN gulp-karma#0.0.5 requires a peer
of karma#>=0.10 <=0.13 but none was installed. npm WARN ui.spa#1.0.0
No repository field. npm ERR! code 1
C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa>npm
install gulp-karma --save ui.spa#1.0.0
C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa
+-- gulp-karma#0.0.5 `-- UNMET PEER DEPENDENCY karma#1.3.0
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.0.14: wanted {"os":"darwin","arch":"any"} (current:
{"os":"win32","arch":"x64"}) npm WARN gulp-karma#0.0.5 requires a peer
of karma#>=0.10 <=0.13 but none was installed. npm WARN ui.spa#1.0.0
No repository field.
C:\Projects\sayusiando.visualstudio.com_git\DigitalLibrary\src\Framework\Framework.UI.Spa>
The root of the problem is that gulp-karma package is deprecated now.