1

I tried to run following Angular project: https://github.com/MangeshPersonal/Observabledemo.git

Cloned it, cd into root folder and did ng serve. Got error:

Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
    at WorkspaceLoader._getProjectWorkspaceFilePath (/usr/local/lib/node_modules/@angular/cli/models/workspace-loader.js:37:19)
    at WorkspaceLoader.loadWorkspace (/usr/local/lib/node_modules/@angular/cli/models/workspace-loader.js:24:21)
    at ServeCommand._loadWorkspaceAndArchitect (/usr/local/lib/node_modules/@angular/cli/models/architect-command.js:180:32)
    at ServeCommand.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/architect-command.js:47:25)
    at Generator.next (<anonymous>)
    at /usr/local/lib/node_modules/@angular/cli/models/architect-command.js:7:71
    at new Promise (<anonymous>)
    at __awaiter (/usr/local/lib/node_modules/@angular/cli/models/architect-command.js:3:12)
    at ServeCommand.initialize (/usr/local/lib/node_modules/@angular/cli/models/architect-command.js:46:16)
    at Object.<anonymous> (/usr/local/lib/node_modules/@angular/cli/models/command-runner.js:87:23)

How to fix this error and make it work? What process should create this angular.json file? How to migrate this older project to a new version of angular?

I am using Angular CLI: 6.0.8 Node: 10.6.0.

Thanks.

Joe
  • 11,983
  • 31
  • 109
  • 183
  • This post can be helpful https://stackoverflow.com/questions/48970553/want-to-upgrade-project-from-angular-v5-to-angular-v6 – vibhor1997a Aug 13 '18 at 04:12

1 Answers1

1

It’s probably because your global @angular/cli , project @angular/cli version or @angular/compiler-cli doesn’t match.

Can you run the following command to verify that

ng -v

If they don't match eg :

"@angular/cli": "6.0.0-rc.3",
"@angular/compiler-cli": "^5.2.0",

Then you need to update or downgrade to match both of these.

Hiteshdua1
  • 2,126
  • 18
  • 29