错误:无法解析“ C:\ Users \ Lenovo \ node_modules \ @ ionic-native \ camera \ ngx”中的“ @ angular / core”

时间:2019-05-03 12:12:26

标签: ionic-framework npm

我在Angular上使用离子平台。

npm install中看到此错误:

C:/Users/Lenovo/node_modules/@ionic-native/camera/ngx/index.js
Module not found: Error: Can't resolve '@angular/core' in 'C:\Users\Lenovo\node_modules\@ionic-native\camera\ngx'

以下是我的AppModule导入列表:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { RouteReuseStrategy } from '@angular/router';

import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
import { SplashScreen } from '@ionic-native/splash-screen/ngx';
import { StatusBar } from '@ionic-native/status-bar/ngx';

import { AppComponent } from './app.component';
import { AppRoutingModule } from './app-routing.module';

import { Camera } from '@ionic-native/camera/ngx';
import { NgProgressModule } from 'ngx-progressbar';

请让我知道我在这里想念的东西。谢谢

1 个答案:

答案 0 :(得分:0)

表明您的插件有问题。 Try to add your camera plugin again. 在终端中,转到项目目录并执行以下两个命令:

ionic cordova plugin add cordova-plugin-camera
npm install @ionic-native/camera

还要确保将可注射服务添加到提供商。