Spring with Angular - Yash-777/MyWorld GitHub Wiki

Check the version and location of node / npm

  • To check the Node.js version, use node -v | npm -v.
  • To find the location of Node.js, use where node or Get-Command node| Get-Command npm on Windows.

Add Node.js to the Environment Variables PATH: Once you've updated the PATH, restart your terminal or PowerShell and check again using the where node or Get-Command node command.

C:\Users\ymerugu>echo %PATH%
  C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;
  D:\ProjectSetup\Jenkins\jdk-11\bin;
  C:\Program Files\Microsoft VS Code\bin;C:\Program Files\WireGuard\;C:\Program Files\Meld\;
  C:\Program Files\Python312;C:\Program Files\Python312\Scripts;
  C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Program Files\MySQL\MySQL Shell 8.0\bin\;
  C:\Users\ymerugu\Documents\softwares\openlogic-openjdk-17.0.12+7-windows-x64\bin;
  C:\Users\ymerugu\AppData\Local\GitHubDesktop\bin;C:\Softwares\Maven\apache-maven-3.8.2\bin;
  C:\Program Files\nodejs\;C:\Users\ymerugu\AppData\Roaming\npm;
PS D:\Eirslett\Frontend\MyAngularApp> node -v
v10.24.1
PS D:\Eirslett\Frontend\MyAngularApp> where node
PS D:\Eirslett\Frontend\MyAngularApp> where node
PS D:\Eirslett\Frontend\MyAngularApp> Get-Command node

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     node.exe                                           10.24.1.0  C:\Program Files\nodejs\node.exe  

PS D:\Eirslett\Frontend\MyAngularApp> npm -v
6.14.12
PS D:\Eirslett\Frontend\MyAngularApp> Get-Command npm

CommandType     Name                                               Version    Source
-----------     ----                                               -------    ------
Application     npm.cmd                                            0.0.0.0    C:\Program Files\nodejs\npm.cmd   

npm commands:

Usage: npm <command>

where <command> is one of:
    access, adduser, audit, bin, bugs, c, cache, ci, cit,
    clean-install, clean-install-test, completion, config,
    create, ddp, dedupe, deprecate, dist-tag, docs, doctor,
    edit, explore, fund, get, help, help-search, hook, i, init,
    install, install-ci-test, install-test, it, link, list, ln,
    login, logout, ls, org, outdated, owner, pack, ping, prefix,
    profile, prune, publish, rb, rebuild, repo, restart, root,
    run, run-script, s, se, search, set, shrinkwrap, star,
    stars, start, stop, t, team, test, token, tst, un,
    uninstall, unpublish, unstar, up, update, v, version, view,
PS D:\Eirslett\Frontend\MyAngularApp> npm start      
npm ERR! missing script: start

checks the information in package.json and angular.json

package.json
{
  "name": "my-App",
  "version": "4.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "build-local": "node --max-old-space-size=6144 ./src/main/my-App/node_modules/@angular/cli/bin/ng build --configuration=local",
    "build-dev": "node --max-old-space-size=6144 ./node_modules/@angular/cli/bin/ng build --configuration=dev",
	"build-qa": "node --max-old-space-size=6144 ./node_modules/@angular/cli/bin/ng build --configuration=qa",

    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^7.2.16",
    ...
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "~0.8.0",
    "@angular-devkit/core": "0.8.3",
    "@angular/cli": "^7.3.10",
    ...
    "typescript": "~3.2.4"
  }
}
angular.json
{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "version": 1,
  "newProjectRoot": "projects",
  "projects": {
    "my-App": {
      "root": "",
      "sourceRoot": "src",
      "projectType": "application",
      "architect": {
        "build": {
          "builder": "@angular-devkit/build-angular:browser",
          "options": {

            "outputPath": "dist",
            "index": "src/index.html",
            "main": "src/main.ts",
            "tsConfig": "src/tsconfig.app.json",
            "polyfills": "src/polyfills.ts",
            "assets": [
              "src/assets",
              "src/favicon.png",
              "src/app/assets/images",
              "src/app/config/*.json",
              "src/api-guide.html",
              "src/api-guide.pdf",
              "src/vorwerk-api-guide.html",
              "src/vorwerk-api-guide.pdf",
              "src/template",
              "src/i18n"
            ],
            "styles": [
              "node_modules/fiori-fundamentals/dist/fiori-fundamentals.css",
              "node_modules/bootstrap/dist/css/bootstrap.min.css",
              "node_modules/line-awesome/dist/css/line-awesome-font-awesome.min.css",
              "node_modules/ag-grid-community/dist/styles/ag-grid.css",
              "node_modules/ag-grid-community/dist/styles/ag-theme-balham.css",
              "node_modules/primeng/resources/primeng.min.css",
              "node_modules/primeng/resources/themes/omega/theme.css",
              "node_modules/eonasdan-bootstrap-datetimepicker/build/css/bootstrap-datetimepicker.min.css",
              "node_modules/ng2-tree/styles.css",
              "src/app/assets/lib/SAP-Icons/4_0_final-icon-package/style.css",
              "node_modules/ngx-ui-switch/ui-switch.component.css",
              "src/styles.scss",
              "src/app/assets/css/ag-grid-theme-overrides.scss"
            ],
            "scripts": [
              "node_modules/jquery/dist/jquery.min.js",
              "node_modules/chart.js/dist/Chart.min.js",
              "node_modules/moment/min/moment.min.js",
              "node_modules/bootstrap/dist/js/bootstrap.min.js",
              "node_modules/moment-timezone/builds/moment-timezone.min.js",
              "node_modules/eonasdan-bootstrap-datetimepicker/src/js/bootstrap-datetimepicker.js"
            ]
          },
          "configurations": {
            "local": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": false,
              "vendorChunk": false,
              "buildOptimizer": true
            },
            "dev": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true
            },
            "qa": {
              "optimization": true,
              "outputHashing": "all",
              "sourceMap": false,
              "extractCss": true,
              "namedChunks": false,
              "aot": true,
              "extractLicenses": true,
              "vendorChunk": false,
              "buildOptimizer": true,
              "fileReplacements": [
                {
                  "replace": "src/styles.scss",
                  "with": "src/styles.qa.scss"
                  }
                ]
            }
          }
        },
        "serve": {
          "builder": "@angular-devkit/build-angular:dev-server",
          "options": {
            "browserTarget": "my-App:build"
          },
          "configurations": {
            "local": {
              "browserTarget": "my-App:build:local"
            },
			"dev": {
              "browserTarget": "my-App:build:dev"
            },
			"qa": {
              "browserTarget": "my-App:build:qa"
            }
          }
        },
        "extract-i18n": {
          "builder": "@angular-devkit/build-angular:extract-i18n",
          "options": {
            "browserTarget": "my-App:build"
          }
        },
        "test": {
          "builder": "@angular-devkit/build-angular:karma",
          "options": {
            "main": "src/test.ts",
            "karmaConfig": "./karma.conf.js",
            "codeCoverage": true,
            "polyfills": "src/polyfills.ts",
            "tsConfig": "src/tsconfig.spec.json",
            "sourceMap": false,
            "assets": [
              "src/assets",
              "src/favicon.png",
              "src/app/assets/images",
              "src/app/config/*.json",
              "src/api-guide.html",
              "src/api-guide.pdf",
              "src/i18n"
            ]
          }
        },
        "lint": {
          "builder": "@angular-devkit/build-angular:tslint",
          "options": {
            "tsConfig": [
              "src/tsconfig.app.json",
              "src/tsconfig.spec.json"
            ],
            "exclude": []
          }
        }
      }
    }
  },
  "defaultProject": "my-App",
  "schematics": {
    "@schematics/angular:component": {
      "prefix": "app",
      "styleext": "css"
    },
    "@schematics/angular:directive": {
      "prefix": "app"
    }
  }
}
⚠️ **GitHub.com Fallback** ⚠️