我使用的離子,並出現以下錯誤:離子:錯誤:模塊構建失敗:錯誤:ENOENT:沒有這樣的文件或目錄
Runtime Error Uncaught (in promise): Error: Module build failed: Error: ENOENT: no such file or directory, open '/Users/richardmarais/Development/ionic/theWhoZoo/src/pages/model/ratingModel.js'
的錯誤是這行代碼的結果:
this.ratingModel = new RatingModel();
當我刪除這一行時,我沒有得到錯誤。
ratingModel.ts
import { Injectable } from "@angular/core";
import { PersonModel } from './personModel';
import { JobModel } from './jobModel';
@Injectable()
export class RatingModel {
public id: number = null;
public job: JobModel = null;
public review: string = null;
public rating: number = null;
public reviewDate: number = null;
public time: string = null;
public person: PersonModel = null;
public anonymous: number = null;
constructor() {
}
}
閱讀其他論壇,人們越來越此錯誤是由於情況下,他們的進口量不匹配,但我已經檢查我的,他們這樣做匹配。
import { RatingModel } from '../model/ratingModel';
不過,我已經發現了一些奇怪的我的IDE(Visual Studio代碼):
正如你可以看到,在搜索結果中,有兩個文件爲對象, ratingModel.ts
和RatingModel.ts
。但是,當我檢查的實際文件系統,只有在文件中,ratingModel.ts
:
問題
有誰知道什麼,以及如何解決是什麼樣子可能是這裏的錯誤或故障?
感謝
更多信息:
global packages:
@ionic/cli-utils : 1.0.0
Cordova CLI : 6.4.0
Ionic CLI : 3.0.0
local packages:
@ionic/app-scripts : 1.3.0
@ionic/cli-plugin-cordova : 1.0.0
@ionic/cli-plugin-ionic-angular : 1.0.0
Ionic Framework : ionic-angular 3.2.1
System:
Node : v7.10.0
OS : macOS Sierra
Xcode : Xcode 8.3.2 Build version 8E2002
ios-deploy : not installed
ios-sim : not installed