小编ljt*_*_69的帖子

离子。ionic 错误。目标入口点“@ionic-native/geolocation”缺少依赖项:[ng] - @ionic-native/core

2021 年 3 月,我安装了 Ionic 6,使用空白模板和“电容器”创建了一个项目。我运行它,一切都很好。现在,我按照离子文档中的指示安装地理位置依赖项,如下所示:

npm install cordova-plugin-geolocation
npm install @ionic-native/geolocation
ionic cap sync
Run Code Online (Sandbox Code Playgroud)

我运行也没有给出任何错误。现在在“home.page.ts”文件中,我导入地理位置依赖项,如下所示:

import { Component } from '@angular/core';
import { Geolocation } from '@ionic-native/geolocation/ngx';
    
    @Component({
      selector: 'app-home',
      templateUrl: 'home.page.html',
      styleUrls: ['home.page.scss'],
    })
    export class HomePage {
    
      constructor(){}
    
    }
Run Code Online (Sandbox Code Playgroud)

我运行该项目并收到以下错误:

[ng] An unhandled exception occurred: The target entry-point "@ionic-native/geolocation" has missing dependencies:
[ng]  - @ionic-native/core
Run Code Online (Sandbox Code Playgroud)

在错误的详细日志中,它告诉我以下内容:

[error] Error: The target entry-point "@ionic-native/geolocation" has missing dependencies:
 - @ionic-native/core

    at TargetedEntryPointFinder.findEntryPoints (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@angular\compiler-cli\ngcc\src\entry_point_finder\targeted_entry_point_finder.js:40:23)
    at C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@angular\compiler-cli\ngcc\src\execution\analyze_entry_points.js:29:41
    at SingleProcessExecutorSync.SingleProcessorExecutorBase.doExecute (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:28:29)
    at C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:59 …
Run Code Online (Sandbox Code Playgroud)

ionic-framework ionic3 angular ionic4 ionic5

4
推荐指数
1
解决办法
5855
查看次数

标签 统计

angular ×1

ionic-framework ×1

ionic3 ×1

ionic4 ×1

ionic5 ×1