Trouble getting an Anguar application to run

Viewed 52

I want to run this Angular app locally but keep getting this error:

"This command is not available when running the Angular CLI outside a workspace"

I have followed the steps from this link:

Error: This command is not available when running the Angular CLI outside a workspace

My .angular-cli.json contains:

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "******"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico"
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.app.json",
      "testTsconfig": "tsconfig.spec.json",
      "prefix": "app",
      "styles": [
        "../node_modules/ion-rangeslider/css/ion.rangeSlider.css",
        "../node_modules/ion-rangeslider/css/ion.rangeSlider.skinFlat.css",

        "assets/css/TimeCircles.css",
        "assets/css/bootstrap.css",
        "assets/css/socicon.css",
        "assets/css/iconsmind.css",
        "assets/css/interface-icons.css",
        "../node_modules/owl.carousel/dist/assets/owl.carousel.css",
        "assets/css/lightbox.min.css",
        "assets/css/theme.css",
        "assets/css/custom.css",
        "styles.css",
        "../node_modules/font-awesome/css/font-awesome.min.css"
      ],
      "scripts": [

        "../node_modules/jquery/dist/jquery.min.js",
        "../node_modules/ion-rangeslider/js/ion.rangeSlider.min.js",
        "../node_modules/owl.carousel/dist/owl.carousel.js",
        "../node_modules/imagesloaded/imagesloaded.pkgd.min.js",
        "assets/js/TimeCircles.js",
        "../node_modules/angular-i18n/angular-locale_nl-nl.js"
      ],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [
    {
      "project": "src/tsconfig.app.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "src/tsconfig.spec.json",
      "exclude": "**/node_modules/**"
    },
    {
      "project": "e2e/tsconfig.e2e.json",
      "exclude": "**/node_modules/**"
    }
  ],
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "css",
    "component": {}
  }
}


I had to install a specific version for Angular cli (1.5) bc of an error which after installation did not show anymore.

After that it started throwing the error:

"This command is not available when running the Angular CLI outside a workspace"

I right click on the src/ folder and click: "Open in Integrated Terminal". But after: ng serve or ng serve --open, it still throws the above error.

How can I get this application to run locally?

0 Answers
Related