Module build failed: TypeError: Cannot read property 'newLine' of undefined

前端 未结 7 827
春和景丽
春和景丽 2021-01-17 16:26

Everything was running fine yesterday, now when I try to ng serve I get these errors:

ERROR in ./src/main.ts Module build failed: TypeError

7条回答
  •  借酒劲吻你
    2021-01-17 16:49

    What worked for me is:

    diff --git a/angular-cli.json b/angular-cli.json
    index d74d5d4..2641672 100644
    --- a/angular-cli.json
    +++ b/angular-cli.json
    @@ -1,7 +1,7 @@
     {
       "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
       "project": {
    -    "version": "1.0.0-beta.31",
    +    "version": "1.0.0-beta.28",
         "name": "renaissance"
       },
       "apps": [
    @@ -22,8 +22,8 @@
             "styles.less"
           ],
           "scripts": [],
    +      "environmentSource": "environments/environment.ts",
           "environments": {
    -        "source": "environments/environment.ts",
             "dev": "environments/environment.ts",
             "prod": "environments/environment.prod.ts"
           }
    diff --git a/package.json b/package.json
    index b91db8f..7e2b083 100644
    --- a/package.json
    +++ b/package.json
    @@ -12,13 +12,13 @@
       },
       "private": true,
       "dependencies": {
    -    "@angular/common": "^2.4.0",
    -    "@angular/compiler": "^2.4.0",
    -    "@angular/core": "^2.4.0",
    -    "@angular/forms": "^2.4.0",
    -    "@angular/http": "^2.4.0",
    -    "@angular/platform-browser": "^2.4.0",
    -    "@angular/platform-browser-dynamic": "^2.4.0",
    +    "@angular/common": "^2.4.8",
    +    "@angular/compiler": "^2.4.8",
    +    "@angular/core": "^2.4.8",
    +    "@angular/forms": "^2.4.8",
    +    "@angular/http": "^2.4.8",
    +    "@angular/platform-browser": "^2.4.8",
    +    "@angular/platform-browser-dynamic": "^2.4.8",
         "@angular/router": "^3.4.0",
         "@ng-bootstrap/ng-bootstrap": "^1.0.0-alpha.20",
         "angularfire2": "^2.0.0-beta.8",
    @@ -27,15 +27,14 @@
         "font-awesome": "^4.7.0",
         "moment": "^2.17.1",
         "ng2-bootstrap": "^1.3.3",
    -    "ng2-page-transition": "^0.2.6",
    +    "ng2-page-transition": "^1.0.4",
         "rxjs": "^5.0.1",
         "ts-helpers": "^1.1.1",
         "web-animations-js": "^2.2.2",
         "zone.js": "^0.7.2"
       },
       "devDependencies": {
    -    "@angular/cli": "1.0.0-beta.31",
    -    "@angular/compiler-cli": "^2.4.0",
    +    "@angular/cli": "^1.0.0-beta.32.3",
         "@types/jasmine": "2.5.38",
         "@types/node": "^6.0.42",
         "codelyzer": "~2.0.0-beta.1",
    @@ -44,8 +43,8 @@
         "karma": "1.2.0",
         "karma-chrome-launcher": "^2.0.0",
         "karma-cli": "^1.0.1",
    -    "karma-jasmine": "^1.0.2",
         "karma-coverage-istanbul-reporter": "^0.2.0",
    +    "karma-jasmine": "^1.0.2",
         "protractor": "~5.1.0",
         "ts-node": "1.2.1",
         "tslint": "^4.3.0",
    diff --git a/src/app/app.module.ts b/src/app/app.module.ts
    index 1f862c6..b6568b7 100644
    --- a/src/app/app.module.ts
    +++ b/src/app/app.module.ts
    @@ -8,7 +8,7 @@ import {NgbModule} from '@ng-bootstrap/ng-bootstrap';
     // App modules/components
     import {LayoutsModule} from "./Components/common/layout/layout.module";
     import {BlochWidgetsModule} from "./Components/common/widgets/widgets.module";
    -import {Ng2PageTransition} from "ng2-page-transition";
    +import {Ng2PageTransitionModule} from "ng2-page-transition";
     //services
     import {PeopleHttpService} from "./Components/common/service/httpPeople.service";
     //auth Module
    @@ -30,9 +30,9 @@ import {MessagingModule} from "./views/messaging/messaging.module";
     @NgModule({
       declarations: [
         AppComponent,
    -    Ng2PageTransition,
       ],
       imports: [
    +    Ng2PageTransitionModule,
         BrowserModule,
         FormsModule,
         HttpModule,
    

提交回复
热议问题