简体   繁体   English

当从angular文档下载项目并运行ng serve -o项目定义时找不到

[英]when download project from angular docs and running ng serve -o project definition could not be found

I am using Angular CLI: 8.1.2 and want to start learning it from Angular IO Tutorial and when i download the code and doing ng serve -o 我正在使用Angular CLI:8.1.2,并希望从Angular IO教程以及当我下载代码并执行ng serve -o时开始学习它

It shows the error: 它显示错误:

The serve command requires to be run in an Angular project, but a project definition could not be found.

I've tried to update it but is not working because I am using the newer angular cli. 我尝试更新它,但是由于我使用的是更新的cli,所以无法正常工作。

Angular File Project Project That I Have been downloaded from https://angular.io/start#getting-started-with-angular-your-first-app : 我已从https://angular.io/start#getting-started-with-angular-your-first-app下载的Angular File Project项目:

!File Project ( https://drive.google.com/file/d/1h_ompEiWsNJ8O5n-xVf2y8Ap2e0GVlNi/view?usp=sharing ) !文件项目( https://drive.google.com/file/d/1h_ompEiWsNJ8O5n-xVf2y8Ap2e0GVlNi/view?usp=sharing

My Angular CLI Version: 我的Angular CLI版本:

!Angular CLI ( https://drive.google.com/file/d/18a-4yMrRFMcIv1cTHvZUf6RW79egOUVY/view?usp=sharing ) !Angular CLI( https://drive.google.com/file/d/18a-4yMrRFMcIv1cTHvZUf6RW79egOUVY/view?usp=sharing

I expected chrome browser pop up and showing my web app. 我希望Chrome浏览器弹出并显示我的Web应用程序。

对于所有新的angular 8学习者,此问题的答案是将ng new复制到您的stackblitz中

You need to go to the folder in question. 您需要转到有问题的文件夹。

So eg if you created your app like this: 因此,例如,如果您这样创建应用程序:

ng new my-first-app

Now you need to first: 现在您需要首先:

cd my-first-app

Then you can run 那你就可以跑

ng serve

Or 要么

npm start

It will work. 它会工作。

Your answer may be here. 您的答案可能在这里。 https://www.djamware.com/post/5bca67d780aca7466989441f/angular-7-tutorial-building-crud-web-application https://www.djamware.com/post/5bca67d780aca7466989441f/angular-7-tutorial-building-crud-web-application

npm install -g @angular/cli ng new angular-new cd angular-new ng serve npm install -g @angular/cli ng new angular-new cd angular-new ng serve

If any problem try this. 如果有任何问题,请尝试此操作。 npm install -g @angular/cli@latest and check your npm -v and node -v npm install -g @angular/cli@latest并检查您的npm -vnode -v

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Angular ng serve 不起作用:Serve 命令需要在 Angular 项目中运行,但找不到项目定义 - Angular ng serve not work:The serve command requires to be run in an Angular project, but a project definition could not be found ng serve 抛出错误“服务命令需要在 Angular 项目中运行,但找不到项目定义” - ng serve throws error "The serve command requires to be run in an Angular project, but a project definition could not be found" ng serve 命令需要在 Angular 项目中运行,但找不到项目定义 - ng serve command requires to be run in an Angular project, but a project definition could not be found 运行 Docker 编写“服务命令需要在 Angular 项目中运行,但找不到项目定义” - Getting “The serve command requires to be run in an Angular project, but a project definition could not be found” running Docker Compose serve命令需要在Angular项目中运行,但是找不到项目定义 - The serve command required to be run in an Angular project, but a project definition could not be found serve 命令需要是 angular 项目,但找不到项目定义 - The serve Command requires to be angular project but project definition could not found 找不到项目定义,服务命令需要在 Angular 项目中运行 - project definition could not be found , serve command requires to be run in an Angular project serve 命令需要在 Angular 项目中运行,但找不到项目定义 - The serve command requires to be run in an Angular project, but a project definition could not be found serve 命令需要在 Angular 项目中运行,但找不到项目定义? - The serve command requires to be run in an Angular project, but a project definition could not be found? 在 docker 容器中运行“ng build”给出“找不到项目定义” - Running "ng build" in docker container gives "project definition could not be found"
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM