How to fix Schematic input does not validate against the Schema:{"clientProject":"Authentication","project":"Authentication"} Errors: Angularuniversal

Viewed 27

I have tried to download the Angular universal package to my application by using the below command :

 ng add @nguniversal/express-engine --clientProject Authentication

The Authentication is the name identifier of my project which is available in my application's angular.json file as below :

angular.json :

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "Authentication": {
      "projectType": "application", 
      "schematics": {},
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/authentication",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
             "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "src/styles.css"
            ],
            "scripts": [

            ]
          },
          "configurations": {
            "production": {
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "500kb",
                  "maximumError": "1mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "2kb",
                  "maximumError": "4kb"
                }
              ],
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "outputHashing": "all"
            },
            "development": {
              "buildOptimizer": false,
              "optimization": false,
              "vendorChunk": true,
              "extractLicenses": false,
              "sourceMap": true,
              "namedChunks": true
            }
          },
          "defaultConfiguration": "production"
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "configurations": {
            "production": {
              "browserTarget": "Authentication:build:production"
            },
            "development": {
              "browserTarget": "Authentication:build:development"
            }
          },
          "defaultConfiguration": "development"
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "Authentication:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.spec.json",
            "karmaConfig": "karma.conf.js",
            "assets": [
              "src/favicon.ico",
              "src/assets"
            ],
            "styles": [
              "src/styles.css"
            ],
            "scripts": []
          }
        }
      }
    }
  }
}

  • The command has been compiled successfully and packages has been installed in my application as below :

package.json:

{
  "name": "authentication",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "watch": "ng build --watch --configuration development",
    "test": "ng test"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^14.0.0",
    "@angular/common": "^14.0.0",
    "@angular/compiler": "^14.0.0",
    "@angular/core": "^14.0.0",
    "@angular/forms": "^14.0.0",
    "@angular/localize": "^14.0.0",
    "@angular/platform-browser": "^14.0.0",
    "@angular/platform-browser-dynamic": "^14.0.0",
    "@angular/router": "^14.0.0",
    "@ng-bootstrap/ng-bootstrap": "^13.0.0",
    "@ngrx/effects": "^14.3.0",
    "@ngrx/router-store": "^14.3.0",
    "@ngrx/store": "^14.3.0",
    "@nguniversal/express-engine": "^14.1.0",
    "@popperjs/core": "^2.10.2",
    "bootstrap": "^5.2.0",
    "rxjs": "~7.5.0",
    "tslib": "^2.3.0",
    "zone.js": "~0.11.4"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^14.2.1",
    "@angular/cli": "~14.2.1",
    "@angular/compiler-cli": "^14.0.0",
    "@ngrx/store-devtools": "^14.3.0",
    "@types/jasmine": "~4.0.0",
    "jasmine-core": "~4.3.0",
    "karma": "~6.4.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage": "~2.2.0",
    "karma-jasmine": "~5.1.0",
    "karma-jasmine-html-reporter": "~2.0.0",
    "typescript": "~4.7.2"
  }
}

  • But still I got an error message as below :
PS C:\Users\Administrator\OneDrive\Documents\Learn-Angular\Angular-Video-Tutorial\Authentication> ng add @nguniversal/express-engine --clientProject Authentication
ℹ Using package manager: npm
✔ Found compatible package version: @nguniversal/express-engine@14.1.0.
✔ Package information loaded.

The package @nguniversal/express-engine@14.1.0 will be installed and executed.
Would you like to proceed? Yes
✔ Packages successfully installed.
Schematic input does not validate against the Schema: {"clientProject":"Authentication","project":"Authentication"}
Errors:

  Data path "" must NOT have additional properties(clientProject).
PS C:\Users\Administrator\OneDrive\Documents\Learn-Angular\Angular-Video-Tutorial\Authentication>

I want to know whether it is okay or need to alter something. Please anyone help me?

0 Answers
Related