[英]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 -v
和node -v
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.