ubuntu - 找不到模块 '@ionic-native/Camera/ngx'

标签 ubuntu ionic-framework npm camera ionic-native

我正在尝试在我的 Ubuntu 20.04 笔记本电脑上运行 Ionic 项目,但是当我运行 ionic serve 时,会出现此错误。我已经完成了 npm install 并且我的 package.json 具有所需的所有依赖项,我知道这一点是因为该项目目前在我的 Windows 10 电脑上运行。我不想安装不同版本的依赖项,因为它会更改 package.json。我不知道还能做什么。这是我的 package.json。

包.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 信息:
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

最佳答案

抱歉我是菜鸟,我的问题的答案只是将导入行 @ionic-native/Camera/ngx 更改为 @ionic-native/camera/ngx。

关于ubuntu - 找不到模块 '@ionic-native/Camera/ngx',我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62186446/

相关文章:

docker - Ubuntu - 升级 docker-compose 版本

ios - ionic Cordova : Is there a way to set fixed cordova-ios version

node.js - vue-template-compiler/package.json 每个新项目都缺少模块

javascript - npm install --save 和 npm install --save-dev 之间的区别

c++ - Ubuntu 编译器 (C++)

php - 从USB串口设备读取数据

mysql - MariaDB 的插入会触发删除所需的软件包,具体取决于 mysql-common

javascript - Angular 1.x - 将事件监听器添加到自定义指令内的元素

javascript - 单击 <ion-col> 的事件在 IONIC 3 应用程序的 iOS 中不起作用

sqlite - NodeJS + AppJS + Sqlite3