简体   繁体   中英

IONIC. Error in ionic.The target entry-point “@ionic-native/geolocation” has missing dependencies: [ng] - @ionic-native/core

March 2021, I install Ionic 6, I create a project with the blank template and with "capacitor". I run it and everything is fine. Now I install the Geolocation dependency as follows as indicated in the ionic documentation:

npm install cordova-plugin-geolocation
npm install @ionic-native/geolocation
ionic cap sync

I run and it doesn't give any error either. Now in the "home.page.ts" file, I import the geolocation dependency as follows:

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(){}
    
    }

I run the project and I get the following error:

[ng] An unhandled exception occurred: The target entry-point "@ionic-native/geolocation" has missing dependencies:
[ng]  - @ionic-native/core

In the detailed log of the error it tells me the following:

[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
    at SyncLocker.lock (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@angular\compiler-cli\ngcc\src\locking\sync_locker.js:34:24)
    at SingleProcessExecutorSync.execute (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@angular\compiler-cli\ngcc\src\execution\single_process_executor.js:57:27)
    at Object.mainNgcc (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@angular\compiler-cli\ngcc\src\main.js:74:25)
    at Object.process (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@angular\compiler-cli\ngcc\index.js:29:23)
    at NgccProcessor.processModule (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@ngtools\webpack\src\ngcc_processor.js:163:16)
    at C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@ngtools\webpack\src\ivy\host.js:55:18
    at C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@ngtools\webpack\src\ivy\host.js:47:24
    at Array.map (<anonymous>)
    at Object.host.resolveModuleNames (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\@ngtools\webpack\src\ivy\host.js:45:32)
    at actualResolveModuleNamesWorker (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\typescript\lib\typescript.js:102904:133)
    at resolveModuleNamesWorker (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\typescript\lib\typescript.js:103126:26)
    at resolveModuleNamesReusingOldState (C:\Users\JAVIERT\Desktop\Proyectos\Ionic\myAppGpsM1\node_modules\typescript\lib\typescript.js:103200:24)

How do I solve the problem?

As @Daniel723 stated in the comments,

npm i @ionic-native/core

worked perfectly for me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM