angular - 找不到项目“mylib”的目标“build”

当我尝试 build 项目 ng build mylib 结果时出现此错误:找不到项目 'mylib' 的目标 'build'

回答1

nx.json
{
  "npmScope": "backbase",
  "affected": {
    "defaultBase": "main"
  },
  "cli": {
    "defaultCollection": "@nrwl/angular",
    "packageManager": "npm"
  },
  "implicitDependencies": {
    "package.json": {
      "dependencies": "*",
      "devDependencies": "*"
    },
    ".eslintrc.json": "*"
  },
  "tasksRunnerOptions": {
    "default": {
      "runner": "@nrwl/workspace/tasks-runners/default",
      "options": {
        "cacheableOperations": ["build", "lint", "test", "e2e"]
      }
    }
  },
  "targetDependencies": {
    "build": [
      {
        "target": "build",
        "projects": "dependencies"
      }
    ]
  },
  "generators": {
    "@nrwl/angular:application": {
      "style": "scss",
      "linter": "eslint",
      "unitTestRunner": "karma",
      "e2eTestRunner": "cypress",
      "prefix": "bb",
      "strict": false
    },
    "@nrwl/angular:library": {
      "linter": "eslint",
      "unitTestRunner": "karma",
      "prefix": "bb",
      "strict": false
    },
    "@nrwl/angular:component": {
      "style": "scss"
    }
  },
  "defaultProject": "retail-usa"
}