Questions & Answers

SOLVED
dluettel
Elite Observer

Angular-Demo

Jump to solution

Hallo Zusammen,

ich versuche das gerade die Angular.js Demo von e-Spirit ans laufen zu bekommen, aber leider funktioniert das nicht so ganz.

Ich habe einmal die Source von e-Spirit erhalten und einmal die package.json.

Zusรคtzlich mal mein Projekt, aber es lรคuft nicht.

Your global Angular CLI version (6.2.4) is greater than your local

version (6.2.3). The local Angular CLI version is used.

To disable this warning use "ng config -g cli.warnings.versionMismatch false".

Local workspace file ('angular.json') could not be found.

Error: Local workspace file ('angular.json') could not be found.

    at WorkspaceLoader._getProjectWorkspaceFilePath (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/models/workspace-loader.js:44:19)

    at WorkspaceLoader.loadWorkspace (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/models/workspace-loader.js:31:21)

    at ServeCommand._loadWorkspaceAndArchitect (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/models/architect-command.js:201:32)

    at ServeCommand.<anonymous> (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/models/architect-command.js:53:25)

    at Generator.next (<anonymous>)

    at /Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/models/architect-command.js:7:71

    at new Promise (<anonymous>)

    at __awaiter (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/models/architect-command.js:3:12)

    at ServeCommand.initialize (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/models/architect-command.js:52:16)

    at Object.<anonymous> (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/models/command-runner.js:127:23)

GruรŸ

Daniel

0 Kudos
1 Solution

Accepted Solutions
neumann
Crownpeak employee

Bitte leg im Ordner noch eine Datei mit dem Namen .angular-cli.json an und fรผg den folgenden Inhalt hinzu

{

  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",

  "project": {

    "name": "demo-app"

  },

  "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": [

        "styles.css"

      ],

      "scripts": [],

      "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": {}

  }

}

View solution in original post

0 Kudos
13 Replies
NMc
Crownpeak employee
Crownpeak employee

Moin Daniel,

das Problem dรผrfte schnell zu lรถsen sein.

Du verwendest eine aktuelle Version des Angular CLI und diese benรถtigt im Gegensatz zur verwendeten Version 1.3.2 eine angular.json.

Ich hab dir eine package.json angehรคngt, die du stattdessen verwenden kannst. Damit solltest du keine Probleme mehr haben.

Vielen Dank fรผr deinen Post, anders wรคre uns das Problem vermutlich nicht aufgefallen.

Kannst du verifizieren, dass das Problem damit gelรถst ist?

freundliche GrรผรŸe

Nico

0 Kudos

Hallo Nico,

ich habe es ausprobiert. Leider klappt es nicht.

GruรŸ

Daniel Lรผttel

0 Kudos
NMc
Crownpeak employee
Crownpeak employee

Moin Daniel,

hast du schon versucht, node_modules zu lรถschen und anschlieรŸend wieder "npm install" (mit der neuen package.json) aufzurufen?

Ich meine mich zu erinnern, dass NPM sonst die Abhรคngigkeiten aus der zuvor verwendeten package.json heranzieht.

GruรŸ

Nico

0 Kudos

Hallo Nico,

genau das habe ich schon probiert. Das ist dann die Versuch in meinem Post von heute morgen.

komisch.

GruรŸ

Daniel Lรผttel

0 Kudos
neumann
Crownpeak employee

Hallo Daniel,

lรถsch bitte auch die package-lock.json, node_modules und รผberschreib nochmal die package-json mit der von Nico angehรคngten Version und ruf dann nochmal npm install auf. Im Log das du geschickt hast, wird nรคmlich wieder die Version 6.x.x des angular-cli verwendet. Es muss aber Version 1.3.2 sein.

LG, Emre

0 Kudos

Hallo Emre,

ich habe das einmal ausprobiert und erhalte jetzt folgendes. Siehe Anhang.

GruรŸ

Daniel Lรผttel

0 Kudos
neumann
Crownpeak employee

Du hast global das angular-cli installiert. Das stรถrt deine versuche, das lokale zu starten. Deinstallier das mal mit

npm uninstall -g angular-cli

und installier mal der Einfachheit halber global das richtige mit

npm install -g @angular/cli@1.3.2

Dann mรผsste das klappen.

0 Kudos

Hallo emre,

dass funktioniert so weit.

Wenn ich jetzt ng serve aufrufe, dann erhalte ich noch die Meldung:

MacBook-Pro:demo luettel$ ng serve

Cannot read property 'config' of null

TypeError: Cannot read property 'config' of null

    at Class.run (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/tasks/serve.js:23:63)

    at check_port_1.checkPort.then.port (/Users/luettel/Entwicklung/FirstSpirit/TPP/demo/node_modules/@angular/cli/commands/serve.js:114:26)

    at process._tickCallback (internal/process/next_tick.js:68:7)

Das steht in meiner config.json

{

  "fsProjectName" : "tpp",

  "caasHost" : "localhost:8081",

  "apikey": "692856de-05f3-13ee-013a-96636cb9a184",

  "useApikey": "true"

}

Die Admin-Oberflรคche vom CaaS ist รผber http://localhost:8282/  erreichbar. Das Projekt heiรŸt tpp.

Habe bewusst auch nochmal alles neu gemacht, damit ich neu starte. Im Anhang das Log-File.

GruรŸ

Daniel Lรผttel

0 Kudos
neumann
Crownpeak employee

Hey Daniel

Ich hab mir nochmal den Inhalt von deinem Archiv.zip Anhang angeschaut. Wenn das alles ist, was du in dem Projekt mitgeliefert bekommen hast dann fehlt da einiges. Tut mir leid, dass ich das zuerst รผbersehen habe.

Ich hab dir jetzt die Dateien, die in deinem Projekt fehlen in ein zip gepackt. Damit mรผsste es klappen.

LG Emre

0 Kudos

Type a product name