मैंने अपनी कोणीय परियोजना में कोणीय सार्वभौमिक लागू किया लेकिन उसके बाद जब भी मैं परियोजना का निर्माण कर रहा हूं तो मुझे त्रुटि से नीचे मिल रहा है

[त्रुटि] त्रुटि: परियोजना मौजूद नहीं है। WorkspaceNodeModulesarchitectHost.findProjectTarget (/home/atif/Desktop/Code/BlogFE/blogui/BlogApp/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js:122) पर: 19) WorkspaceNodeModulesarchitectHost.getBuilderNameForTarget (/home/atif/Desktop/Code/BlogFE/blogui/BlogApp/node_modules/@angular/cli/node_modules/@angular-devkit/architect/node/node-modules-architect-host.js) पर: 23:39) RunCommand.runSingleTarget (/home/atif/Desktop/Code/BlogFE/blogui/BlogApp/node_modules/@angular/cli/models/architect-command.js:174:55) पर RunCommand.runarchitectTarget (/home) पर /atif/Desktop/Code/BlogFE/blogui/BlogApp/node_modules/@angular/cli/models/architect-command.js:217:35) RunCommand.run पर (/home/atif/Desktop/Code/BlogFE/blogui/ BlogApp/node_modules/@angular/cli/commands/run-impl.js:14:25) RunCommand.validateAndRun पर (/home/atif/Desktop/Code/BlogFE/blogui/BlogApp/node_modules/@angular/cli/models/ command.js:134:39) async Object.runCommand (/home/atif/Deskto) पर p/Code/BlogFE/blogui/BlogApp/node_modules/@angular/cli/models/command-runner.js:201:24) async default_1 पर (/home/atif/Desktop/Code/BlogFE/blogui/BlogApp/node_modules/ @angular/cli/lib/cli/index.js:62:31)

कोणीय.जेसन फ़ाइल

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "blogapp": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "scss"
        }
      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {
            "outputPath": "dist/browser",
            "index": "src/index.html",
            "main": "src/main.ts",
            "polyfills": "src/polyfills.ts",
            "tsConfig": "tsconfig.app.json",
            "aot": true,
            "assets": [
              "src/favicon.ico",
              "src/assets",
              "src/sitemap.xml",
              "src/robots.txt"
            ],
            "styles": [
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "node_modules/font-awesome/css/font-awesome.min.css",
              "src/styles.scss"
            ],
            "scripts": [
              "./node_modules/jquery/dist/jquery.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js"
            ]
          },
          "configurations": {
            "production": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "budgets": [
                {
                  "type": "initial",
                  "maximumWarning": "2mb",
                  "maximumError": "10mb"
                },
                {
                  "type": "anyComponentStyle",
                  "maximumWarning": "6kb",
                  "maximumError": "10kb"
                }
              ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "blogapp:build"
          },
          "configurations": {
            "production": {
              "browserTarget": "blogapp:build:production"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "blogapp: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",
              "src/sitemap.xml",
              "src/robots.txt"
            ],
            "styles": [
              "src/styles.scss"
            ],
            "scripts": []
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "tsconfig.app.json",
              "tsconfig.spec.json",
              "e2e/tsconfig.json"
            ],
            "exclude": [
              "**/node_modules/**"
            ]
          }
        },
        "e2e": {
          "builder": "@angular-devkit/build-angular:protractor",
          "options": {
            "protractorConfig": "e2e/protractor.conf.js",
            "devServerTarget": "blogapp:serve"
          },
          "configurations": {
            "production": {
              "devServerTarget": "blogapp:serve:production"
            }
          }
        },
        "server": {
          "builder": "@angular-devkit/build-angular:server",
          "options": {
            "outputPath": "dist/server",
            "main": "src/main.server.ts",
            "tsConfig": "tsconfig.server.json"
          },
          "configurations": {
            "production": {
              "outputHashing": "media",
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.prod.ts"
                }
              ],
              "sourceMap": false,
              "optimization": true
            },
            "serverless": {
              "fileReplacements": [
                {
                  "replace": "src/environments/environment.ts",
                  "with": "src/environments/environment.serverless.ts"
                }
              ]
            }
          }
        }
      }
    }
  },
  "defaultProject": "blogapp"
}

पैकेज.जेसन फ़ाइल

{
  "name": "blogapp",
  "version": "0.0.0",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "compile:server": "webpack --config webpack.server.config.js --progress --colors",
    "serve:ssr": "node dist/server",
    "build:ssr": "ng build --prod && ng run universal-website:server:production && npm run compile:server",
    "build:client-and-server-bundles": "ng build --prod && ng run blogapp:server:production --bundleDependencies all",
    "server": "node local.js",
    "build:prod": "npm run build:browser:prod && npm run build:server:prod",
    "serve:prerender": "node static.js",
    "build:prerender": "npm run build:prod && node dist/prerender.js",
    "build:browser:prod": "ng build --prod",
    "build:browser:serverless": "ng build --prod --base-href /production/",
    "build:serverless": "npm run build:browser:serverless && npm run build:server:serverless",
    "build:prod:deploy": "npm run build:prod && npm run deploy",
    "build:serverless:deploy": "npm run build:serverless && npm run deploy",
    "deploy": "serverless deploy",
    "build:server:prod": "ng run universal-website:server:production && npm run compile:server",
    "build:server:serverless": "ng run universal-website:server:serverless && npm run compile:server",
    "terminate": "serverless remove"
  },
  "private": true,
  "dependencies": {
    "@angular-devkit/schematics": "^9.1.0",
    "@angular/animations": "~9.1.6",
    "@angular/common": "~9.1.6",
    "@angular/compiler": "~9.1.6",
    "@angular/core": "~9.1.6",
    "@angular/forms": "~9.1.6",
    "@angular/platform-browser": "~9.1.6",
    "@angular/platform-browser-dynamic": "~9.1.6",
    "@angular/platform-server": "~9.1.6",
    "@angular/router": "~9.1.6",
    "@ng-toolkit/serverless": "^8.1.0",
    "@ng-toolkit/universal": "^8.0.3",
    "@nguniversal/common": "8.1.0",
    "@nguniversal/express-engine": "v8.2.6",
    "@nguniversal/module-map-ngfactory-loader": "v8.2.6",
    "@schematics/angular": "^9.1.0",
    "@syncfusion/ej2-angular-richtexteditor": "^18.2.56",
    "@vendia/serverless-express": "^4.3.4",
    "aws-sdk": "^2.797.0",
    "aws-serverless-express": "^3.3.6",
    "bootstrap": "^3.3.7",
    "cors": "^2.8.5",
    "domino": "^2.1.3",
    "express": "^4.15.2",
    "font-awesome": "^4.7.0",
    "jquery": "^3.5.1",
    "ng-lazyload-image": "^9.1.0",
    "ngx-spinner": "^10.0.1",
    "rxjs": "~6.5.4",
    "tslib": "^1.10.0",
    "web-animations-js": "^2.3.2",
    "zone.js": "~0.10.2"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.901.15",
    "@angular/cli": "^9.1.6",
    "@angular/compiler-cli": "~9.1.6",
    "@types/express": "^4.17.0",
    "@types/jasmine": "~3.5.0",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "^12.19.6",
    "codelyzer": "^5.1.2",
    "jasmine-core": "~3.5.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~5.0.0",
    "karma-chrome-launcher": "~3.1.0",
    "karma-coverage-istanbul-reporter": "~2.1.0",
    "karma-jasmine": "~3.0.1",
    "karma-jasmine-html-reporter": "^1.4.2",
    "opencollective": "^1.0.3",
    "protractor": "~5.4.3",
    "serverless": "^2.29.0",
    "serverless-api-compression": "^1.0.1",
    "serverless-apigw-binary": "^0.4.4",
    "ts-loader": "^6.2.1",
    "ts-node": "~8.3.0",
    "tslint": "~6.1.0",
    "typescript": "~3.8.3",
    "webpack-cli": "^3.3.10"
  }
}


जब भी मैं npm रन बिल्ड चलाता हूं, मूल रूप से मुझे यह त्रुटि मिलती है: ssr

0
Atif 14 मार्च 2021, 22:06

1 उत्तर

सबसे बढ़िया उत्तर

समस्या का समाधान हो जाता है क्योंकि कोड पैकेज.json में कमांड चलाकर किया जाता है

एनजी जोड़ें @ एनजी-टूलकिट/सार्वभौमिक add

गलत परियोजना नाम के लिए भेजा गया

"build:ssr": "ng build --prod && ng run **universal-website**:server:production && npm run compile:server"

जिसे मैंने बदल दिया

"build:ssr": "ng build --prod && ng run blogapp:server:production && npm run compile:server",
0
Atif 15 मार्च 2021, 10:31