Jimmy Porto
Jimmy Porto

Reputation: 139

Cannot find module 'UNMET/package.json'

I'm trying to install a cordova plugin in my ionic app. But Every time and every plugin I try to install throws an error:

Cannot find module 'UNMET/package.json'

I already have to delete the paths: node_modules, plugins, platforms, www a lot of times.

I run:

npm install

ionic cordova plugin add cordova-plugin-local-notification

ionic cordova platform add android

and I tryied to change the order of this, but the problem don't be solved.

I'm running in a Ubuntu 18, ionic version is 4.8.0, cordova version is 9.0.0, cordova-lib 9.0.1, node version 8.10.0, npm 3.5.2.

I just run this line in terminal:

ionic cordova plugin add cordova-plugin-local-notification

my package json:

{
  "name": "project-name",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "android": "ionic cordova run android",
    "start": "ionic-app-scripts serve",
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "buildAndroid": "ionic cordova build android --aot --minifyjs --minifycss"
  },
  "dependencies": {
    "@angular/animations": "5.2.11",
    "@angular/common": "5.2.11",
    "@angular/compiler": "5.2.11",
    "@angular/compiler-cli": "5.2.11",
    "@angular/core": "5.2.11",
    "@angular/fire": "^5.1.1",
    "@angular/forms": "5.2.11",
    "@angular/http": "5.2.11",
    "@angular/platform-browser": "5.2.11",
    "@angular/platform-browser-dynamic": "5.2.11",
    "@ionic-native/background-geolocation": "^4.20.0",
    "@ionic-native/base64": "^4.20.0",
    "@ionic-native/camera": "^4.20.0",
    "@ionic-native/core": "~4.18.0",
    "@ionic-native/crop": "^4.20.0",
    "@ionic-native/facebook": "^4.20.0",
    "@ionic-native/geolocation": "^4.20.0",
    "@ionic-native/google-plus": "^4.20.0",
    "@ionic-native/local-notifications": "^4.20.0",
    "@ionic-native/location-accuracy": "^4.20.0",
    "@ionic-native/social-sharing": "^4.20.0",
    "@ionic-native/splash-screen": "~4.18.0",
    "@ionic-native/sqlite": "^4.20.0",
    "@ionic-native/status-bar": "~4.18.0",
    "@ionic/storage": "2.2.0",
    "@mauron85/cordova-plugin-background-geolocation": "3.0.3",
    "brmasker-ionic-3": "^1.6.3",
    "com-badrit-base64": "^0.2.0",
    "cordova-plugin-badge": "^0.8.8",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-crop": "^0.4.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-geolocation": "4.0.2",
    "cordova-plugin-googleplus": "7.0.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^3.1.2",
    "cordova-plugin-local-notification": "0.9.0-beta.2",
    "cordova-plugin-request-location-accuracy": "2.3.0",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-socialsharing": "5.4.7",
    "cordova-sqlite-storage": "^3.2.0",
    "es6-promise-plugin": "4.2.2",
    "firebase": "^5.8.4",
    "ionic-angular": "3.9.3",
    "ionicons": "3.0.0",
    "ngx-multilingual": "0.0.3",
    "rxjs": "5.5.11",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.29"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.2.1",
    "@ionic/lab": "1.0.20",
    "typescript": "~2.6.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {},
      "cordova-sqlite-storage": {},
      "com-badrit-base64": {},
      "cordova-plugin-camera": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-crop": {},
      "cordova-plugin-mauron85-background-geolocation": {
        "GOOGLE_PLAY_SERVICES_VERSION": "11+",
        "ANDROID_SUPPORT_LIBRARY_VERSION": "26+",
        "ICON": "@mipmap/icon",
        "SMALL_ICON": "@mipmap/icon",
        "ACCOUNT_NAME": "@string/app_name",
        "ACCOUNT_LABEL": "@string/app_name",
        "ACCOUNT_TYPE": "$PACKAGE_NAME.account",
        "CONTENT_AUTHORITY": "$PACKAGE_NAME"
      },
      "cordova-plugin-googleplus": {
        "PLAY_SERVICES_VERSION": "11.8.0"
      },
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": "Para pegar as melhores promoções"
      },
      "cordova-plugin-request-location-accuracy": {
        "PLAY_SERVICES_LOCATION_VERSION": "16.+"
      },
      "cordova-plugin-x-socialsharing": {
        "ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
      },
      "cordova-plugin-local-notification": {}
    },
    "platforms": [
      "android"
    ]
  }
}

But every plugin throw this error.

I just need to install plugins in my app again.

Upvotes: 1

Views: 815

Answers (1)

Sokatoha
Sokatoha

Reputation: 66

Just update npm and you'll be able to build again :)

Upvotes: 1

Related Questions