我只使用"离子服务"运行我的应用程序命令,我收到此错误
> ionic-hello-world@ watch C:\Users\adirz\myapps\eventapp
> ionic-app-scripts watch
[14:39:48] ionic-app-scripts 0.0.30
[14:39:48] watch started ...
[14:39:48] build dev started ...
[14:39:48] clean started ...
[14:39:48] clean finished in 10 ms
[14:39:48] copy started ...
[14:39:48] bundle dev started ...
I'm the Hulk
[14:39:49] lint started ...
[14:39:49] copy finished in 253 ms
[14:39:49] lint finished in 590 ms
[14:39:52] C:/Users/adirz/myapps/eventapp/src/app/app.component.ts(26,11): error TS1005: ';' expected.
[14:39:52] C:/Users/adirz/myapps/eventapp/src/app/app.component.ts(26,18): error TS1144: '{' or ';' expected.
[14:39:52] C:/Users/adirz/myapps/eventapp/src/app/app.component.ts(26,38): error TS1138: Parameter declaration expected.
[14:39:52] C:/Users/adirz/myapps/eventapp/src/app/app.component.ts(34,4): error TS1005: ';' expected.
[14:39:52] C:/Users/adirz/myapps/eventapp/src/app/app.component.ts(35,23): error TS1005: ',' expected.
[14:39:52] C:/Users/adirz/myapps/eventapp/src/app/app.component.ts(35,35): error TS1005: ';' expected.
[14:39:52] C:/Users/adirz/myapps/eventapp/src/app/app.component.ts(43,1): error TS1128: Declaration or statement expected.
[14:39:52] bundle dev failed: Error transforming C:/Users/adirz/myapps/eventapp/src/app/app.component.ts with 'ion-compiler' plugin: There were TypeScript errors transpiling
[14:39:52] Error: Error transforming C:/Users/adirz/myapps/eventapp/src/app/app.component.ts with 'ion-compiler' plugin: There were TypeScript errors transpiling
at Object.transpile (C:\Users\adirz\myapps\eventapp\node_modules\@ionic\app-scripts\dist\transpile.js:39:15)
at Object.transform (C:\Users\adirz\myapps\eventapp\node_modules\@ionic\app-scripts\dist\plugins\ion-compiler.js:26:36)
at C:\Users\adirz\myapps\eventapp\node_modules\rollup\dist\rollup.js:8270:35
Running live reload server: http://localhost:35729
Watching: www/**/*, !www/lib/**/*, !www/**/*.map
√ Running dev server: http://localhost:8100
Ionic server commands, enter:
restart or r to restart the client app from the root
goto or g and a url to have the app navigate to the given url
consolelogs or c to enable/disable console log output
serverlogs or s to enable/disable server log output
quit or q to shutdown the server and exit
ionic $
这是我的app.module.ts-我没有看到任何遗漏,例如cmd显示错误
import { NgModule } from '@angular/core';
import { IonicApp, IonicModule } from 'ionic-angular';
import { MyApp } from './app.component';
// Import pages
import { HomePage } from '../pages/home/home';
import { LoginPage } from '../pages/login/login';
import { ResetPasswordPage } from '../pages/reset-password/reset-password';
import { SignupPage } from '../pages/signup/signup';
// Import providers
import { AuthData } from '../providers/auth-data';
@NgModule({
declarations: [
MyApp,
HomePage,
LoginPage,
ResetPasswordPage,
SignupPage
],
imports: [
IonicModule.forRoot(MyApp)
],
bootstrap: [IonicApp],
entryComponents: [
MyApp,
HomePage,
LoginPage,
ResetPasswordPage,
SignupPage
],
providers: [
AuthData,
]
})
export class AppModule {}
我试图找出它是什么但我真的没有看到任何问题。
答案 0 :(得分:0)
我通过在app.component.ts中更改我的构造函数来解决它,我有一些必须在其他行之前的行,它会产生问题。 另外,检查所有拼写和组件,并检查它是否正确名称。