gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 07:56:57 32 4
gpt4 key购买 nike

2021 年 3 月,我安装了 Ionic 6,我使用空白模板和“电容器”创建了一个项目。我运行它,一切都很好。现在我按照 ionic 文档中的说明安装 Geolocation 依赖项:

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

我运行它也没有给出任何错误。现在在“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(){}

}

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

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

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

[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)

我该如何解决这个问题?

最佳答案

正如@Daniel723 在评论中所说,

npm i @ionic-native/core

非常适合我。

关于angular - ionic 。 ionic 错误。目标入口点 “@ionic-native/geolocation” 缺少依赖项 : [ng] - @ionic-native/core,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66653243/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com