简体   繁体   中英

Invalid rule result: Function()

I am updating angular 6 to angular 7, following the instructions as per the angular official site .

During the update session:
I entered the command to update the angular/cli and core for the v7
$ ng update @angular/cli@v7 @angular/core@v7 .

After updating I got the Invalid rule result: Function() .

Here is the command-prompt output:

added 106 packages from 85 contributors, removed 5 packages, updated 5 packages, moved 1 package and audited 36489 packages in 39.604s
found 18 vulnerabilities (12 low, 1 moderate, 5 high)
  run `npm audit fix` to fix them, or `npm audit` for details
Invalid rule result: Function().

Does anyone know why I am getting the message?

This is the dependencies in the package.json file.

"dependencies": {
    "@angular/animations": "^8.0.0",
    "@angular/cdk": "^7.3.7",
    "@angular/common": "^8.0.0",
    "@angular/compiler": "^8.0.0",
    "@angular/core": "^8.0.0",
    "@angular/forms": "^8.0.0",
    "@angular/http": "^6.0.3",
    "@angular/material": "^7.3.7",
    "@angular/platform-browser": "^8.0.0",
    "@angular/platform-browser-dynamic": "^8.0.0",
    "@angular/router": "^8.0.0",
    "core-js": "^2.5.4",
    "hammerjs": "^2.0.8",
    "ngx-loading": "^3.0.1",
    "rxjs": "6.5.2",
    "underscore": "^1.9.1",
    "zone.js": "^0.9.1"
},
"devDependencies": {
    "@angular-devkit/build-angular": "~0.6.8",
    "@angular/cli": "~7.3.9",
    "@angular/compiler-cli": "^8.0.0",
    "@angular/language-service": "^8.0.0",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "bootstrap-sass": "^3.3.7",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.0",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-scss-preprocessor": "^3.0.0",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1",
    "typescript": "~3.4.5"
}

I spent quite a lot of time fighting this problem. As with almost all of these Angular Upgrade errors it is well worth upgrading the Angular dependencies of your solution to the max version within the same major version (in our case 6). This should be safe to do and will bring in any patches from the Angular team.

I upgraded the Angular CLI within my dev dependencies from "@angular/cli": "6.0.3", to "@angular/cli": "6.2.9", . At the time of writing this was the newest supported version within the same major version. You can do this using the following command:

ng update @angular/cli@6.2.9

After this I was able to run ng update @angular/cli@7 @angular/core@7 without experiencing the error "Invalid rule result: Function()."

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM