【问题标题】:Error: Cannot find module "@ionic/angular"错误:找不到模块“@ionic/angular”
【发布时间】:2019-05-10 10:22:25
【问题描述】:

我正在尝试从 https://github.com/hsuanxyz/ion2-calendar

但是当我尝试导入到我的 app.module.ts

我得到这个错误:

Uncaught Error: Cannot find module "@ionic/angular"
at webpackMissingModule (calendar.modal.js:13)
at Object.<anonymous> (calendar.modal.js:13)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.<anonymous> (index.js:7)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.355 (main.ts:5)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at Object.332 (main.ts:1)
at __webpack_require__ (bootstrap ff18038c92faa82fd673:54)
at webpackJsonpCallback (bootstrap ff18038c92faa82fd673:25)

我的 app.module.ts

import { BrowserModule } from '@angular/platform-browser';
import { ErrorHandler, NgModule } from '@angular/core';
import { IonicApp, IonicErrorHandler, IonicModule } from 'ionic-angular';
import { SplashScreen } from '@ionic-native/splash-screen';
import { StatusBar } from '@ionic-native/status-bar';

import { MyApp } from './app.component';
import { HomePage } from '../pages/home/home';
import { Http, Headers, RequestOptions, HttpModule } from '@angular/http';
import { CalendarModule } from 'ion2-calendar';


@NgModule({
declarations: [
MyApp,
HomePage
],
imports: [
BrowserModule,HttpModule,
IonicModule.forRoot(MyApp),
CalendarModule
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage
],
providers: [
StatusBar,
SplashScreen,
{provide: ErrorHandler, useClass: IonicErrorHandler}
]
})
export class AppModule {}

不知道怎么回事

【问题讨论】:

  • 根据错误,请检查节点模块中是否存在@ionic-angular文件夹
  • 谢谢你的回复,不,我不明白我该怎么办
  • 删除节点模块并重新安装检查]
  • 我得到同样的错误
  • 向我们展示指向 ionic 和 ionic-angular 文件夹的节点模块结构

标签: ionic-framework ionic3


【解决方案1】:

看起来您已经下载了该库的 ionic 4 版本。尝试使用https://github.com/HsuanXyz/ion2-calendar/tree/v2 这个版本是为ionic-angular 而不是@ionic/angular 设置的,它看起来像你的版本。希望这会有所帮助:)

【讨论】:

猜你喜欢
  • 2018-06-01
  • 1970-01-01
  • 2018-10-08
  • 2021-01-20
  • 1970-01-01
  • 2019-02-15
  • 2018-07-11
  • 2019-07-03
  • 2017-02-08
相关资源
最近更新 更多