Search code examples
ubuntuionic-frameworknpmcameraionic-native

Cannot find module '@ionic-native/Camera/ngx'


I am trying to run an Ionic project in my Ubuntu 20.04 laptop but when I run ionic serve this error shows up. I have done npm install and my package.json has all the dependencies needed, I know this because this project currently runs on my Windows 10 pc. I don't want to install different versions of my dependencies because it will change the package.json. I don't know what else to do. This is my package.json.

package.json:

{
  "name": "keri_user",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@agm/core": "^1.0.0",
    "@angular/common": "^7.2.2",
    "@angular/core": "^7.2.2",
    "@angular/forms": "^7.2.2",
    "@angular/http": "^7.2.2",
    "@angular/platform-browser": "^7.2.2",
    "@angular/platform-browser-dynamic": "^7.2.2",
    "@angular/router": "^7.2.2",
    "@capacitor/android": "^1.2.1",
    "@capacitor/core": "1.2.1",
    "@ionic-native/call-number": "^5.17.1",
    "@ionic-native/camera": "^5.19.1",
    "@ionic-native/core": "^5.0.0",
    "@ionic-native/facebook": "^5.21.1",
    "@ionic-native/geolocation": "^5.17.1",
    "@ionic-native/sms": "^5.17.1",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^4.1.0",
    "@types/googlemaps": "^3.37.7",
    "agm-direction": "^0.7.9",
    "angular2-actioncable": "^6.0.2",
    "call-number": "^1.0.1",
    "cordova-android": "8.1.0",
    "cordova-plugin-camera": "^4.1.0",
    "cordova-plugin-facebook4": "^6.2.0",
    "cordova-plugin-geolocation": "^4.0.2",
    "cordova-sms-plugin": "^1.0.0",
    "core-js": "^2.5.4",
    "platform": "1.3.5",
    "rxjs": "~6.5.1",
    "rxjs-compat": "^6.5.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.8.29"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.13.8",
    "@angular-devkit/build-angular": "~0.13.8",
    "@angular-devkit/core": "~7.3.8",
    "@angular-devkit/schematics": "~7.3.8",
    "@angular/cli": "~7.3.8",
    "@angular/compiler": "~7.2.2",
    "@angular/compiler-cli": "~7.2.2",
    "@angular/language-service": "~7.2.2",
    "@capacitor/cli": "1.2.1",
    "@fortawesome/angular-fontawesome": "^0.4.0",
    "@fortawesome/fontawesome-free": "^5.10.0",
    "@fortawesome/fontawesome-svg-core": "^1.2.20",
    "@fortawesome/free-brands-svg-icons": "^5.10.0",
    "@fortawesome/free-regular-svg-icons": "^5.10.0",
    "@fortawesome/free-solid-svg-icons": "^5.10.0",
    "@ionic/angular-toolkit": "~1.5.1",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~12.0.0",
    "codelyzer": "~4.5.0",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.1.2",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "~8.3.0",
    "tslint": "~5.17.0",
    "typescript": "~3.1.6"
  },
  "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-plugin-geolocation": {},
      "mx.ferreyra.callnumber": {},
      "cordova-sms-plugin": {},
      "cordova-plugin-camera": {
        "ANDROID_SUPPORT_V4_VERSION": "27.+"
      },
      "cordova-plugin-facebook4": {
        "APP_ID": "736193720137883",
        "APP_NAME": "Keri",
        "FACEBOOK_HYBRID_APP_EVENTS": "false",
        "FACEBOOK_ANDROID_SDK_VERSION": "5.5.2"
      }
    },
    "platforms": [
      "android"
    ]
  }
}

ionic info:

Ionic:

   Ionic CLI                     : 5.4.16 (/home/chano/.nvm/versions/node/v12.18.0/lib/node_modules/ionic)
   Ionic Framework               : @ionic/angular 4.6.2
   @angular-devkit/build-angular : 0.13.9
   @angular-devkit/schematics    : 7.3.9
   @angular/cli                  : 7.3.9
   @ionic/angular-toolkit        : 1.5.1

Capacitor:

   Capacitor CLI   : 1.2.1
   @capacitor/core : 1.2.1

Cordova:

   Cordova CLI       : 9.0.0 (cordova-lib@9.0.1)
   Cordova Platforms : not available
   Cordova Plugins   : not available

Utility:

   cordova-res : not installed
   native-run  : not installed

System:

   NodeJS : v12.18.0 (/home/chano/.nvm/versions/node/v12.18.0/bin/node)
   npm    : 6.14.4
   OS     : Linux 5.4

Solution

  • sorry for being noob, the answer to my question was just to change the import line @ionic-native/Camera/ngx to @ionic-native/camera/ngx.