The Nx build system doesn't see the projects inside the workspace

66 views Asked by At

I'm using this (1-year-old) Nx tutorial https://www.youtube.com/watch?v=M5NwkRNrpK0 At 10:30 they call: "npx nx start ngproj-a" and everything is built just fine.

When I do the same thing "npx nx build ucm-system-hosting" I get - "Cannot find project 'ucm-system-hosting'", so the question is what can be wrong, is it an obsolete tutorial or I'm doing something wrong? Also, the Nx console plugin for the IntelliJ IDEA does not show any project (funny that the Visual Studio plugin works better)

This is my project structure:

enter image description here

This is the apps/ucm-system-hosting/angular.json:

{
  "$schema": "../../node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "ucm-system-hosting": {
      "projectType": "application",
      "schematics": {
        "@schematics/angular:component": {
          "style": "less"
        },
        "@schematics/angular:application": {
          "strict": true
        }
      },
      "root": "",
      "sourceRoot": "src",
      "prefix": "app",
...

apps/ucm-system-hosting/package.json

{
  "name": "ucm-system-hosting",
  "version": "1.0.1",
  "scripts": {
    "ng": "ng",
    "build": "ng build",
    "serve": "ng serve --configuration=uk",
    "build - prod": "ng build --configuration=production && npm run \"build landing\"",
    "build landing": "cd ../google-cloud-landing && npm run build && cd   && copyfiles -u 3 -E ../google-cloud-landing/dist/**/*.* ./public",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "localization - extract language file": "ng extract-i18n --output-path src/locale",
    "deploy:firebase": "npm run \"build - prod\" && firebase deploy --only hosting"
  },
  "private": true,
  "dependencies": {
  }
}

nx.json:

{
  "$schema": "./node_modules/nx/schemas/nx-schema.json",
  "affected": {
    "defaultBase": "main"
  },
  "tasksRunnerOptions": {
    "default": {
      "runner": "nx/tasks-runners/default",
      "options": {

        "cacheableOperations": ["build", "serve"]
      }
    }
  }
}
0

There are 0 answers