Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
ghost opened this issue Jun 6, 2018 · 9 comments
Closed

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

ghost opened this issue Jun 6, 2018 · 9 comments
Labels
needs: repro steps We cannot reproduce the issue with the information given

Comments

@ghost
Copy link

ghost commented Jun 6, 2018

Bug Report or Feature Request (mark with an x)

- [x] bug report -> please search issues before submitting
- [ ] feature request

Area

- [x] devkit
- [ ] schematics

Versions

Angular CLI: 6.0.8
Node: 8.11.2
OS: win32 x64
Angular: 6.0.3
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

Package Version
-----------------------------------------------------------
@angular-devkit/architect 0.6.8
@angular-devkit/build-angular 0.6.8
@angular-devkit/build-optimizer 0.6.8
@angular-devkit/core 0.6.8
@angular-devkit/schematics 0.6.8
@angular/cli 6.0.8
@ngtools/webpack 6.0.8
@schematics/angular 0.6.8
@schematics/update 0.6.8
rxjs 6.2.0
typescript 2.7.2
webpack 4.8.3

Windows 7 x64

Repro steps

In VS Code Integrated Terminal:
ng new sample

Then:
npm install --save @ng-bootstrap/ng-bootstrap

And then:
ng serve --open

The log given by the failure

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

Desired functionality

It should open the browser and show the running angular app

Mention any other details that might be useful

@filipesilva
Copy link
Contributor

Hi, I can't see that behaviour when following your repro. Can you provide a repository where this happens please?

Just to confirm though, did you change directory into sample after ng new? Because if you didn't, you're still outside of the project and not serving anything.

@filipesilva filipesilva added the needs: repro steps We cannot reproduce the issue with the information given label Jun 7, 2018
@hansl
Copy link
Contributor

hansl commented Jun 7, 2018

Dupe of #10757

@hansl hansl closed this as completed Jun 7, 2018
@gargolillas
Copy link

You have to run ng serve --open in the same folder that creates your project. In your case the folder sample

@sathyaprakash94
Copy link

The steps are all fine except you have to do one more step to run the angular application.
Pls change the directory >cd sample
and then run the command >ng serve
Hope this will create the initial environment successfully.

@molcik
Copy link

molcik commented Jul 12, 2018

For people googling this error. It’s probably because your global @angular/cli version and @angular/compiler-cli are differentf here is how to fix it (my blog).

@attishrj
Copy link

attishrj commented Aug 18, 2018

This is because you have install angular in some directory and trying to use ng serve without creating your new project set-up
Generating and serving an Angular project via a development server
ng new PROJECT-NAME
cd PROJECT-NAME
ng serve
https://www.npmjs.com/package/@angular/cli#generating-and-serving-an-angular-project-via-a-development-server

@sameensg
Copy link

sameensg commented Sep 12, 2018

I am facing following error:

Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\workspace-loader.js:44:19)
at WorkspaceLoader.loadWorkspace (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\workspace-loader.js:31:21)
at ServeCommand._loadWorkspaceAndArchitect (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:201:32)
at ServeCommand. (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:53:25)
at Generator.next ()
at F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:7:71
at new Promise ()
at __awaiter (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:3:12)
at ServeCommand.initialize (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:52:16)
at Object. (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\command-runner.js:127:23)

@josuepr2
Copy link

I am facing following error:

Local workspace file ('angular.json') could not be found.
Error: Local workspace file ('angular.json') could not be found.
at WorkspaceLoader._getProjectWorkspaceFilePath (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\workspace-loader.js:44:19)
at WorkspaceLoader.loadWorkspace (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\workspace-loader.js:31:21)
at ServeCommand._loadWorkspaceAndArchitect (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:201:32)
at ServeCommand. (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:53:25)
at Generator.next ()
at F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:7:71
at new Promise ()
at __awaiter (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:3:12)
at ServeCommand.initialize (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\architect-command.js:52:16)
at Object. (F:\Angular Projects\coreui-free-bootstrap-admin-template-master\node_modules@angular\cli\models\command-runner.js:127:23)

I'm having the same issue

@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: repro steps We cannot reproduce the issue with the information given
Projects
None yet
Development

No branches or pull requests

8 participants