简体   繁体   English

ng serve无法在devDependencies中找到“@ angular / cli”

[英]ng serve Unable to find “@angular/cli” in devDependencies

$ ng serve Unable to find "@angular/cli" in devDependencies. $ ng serve无法在devDependencies中找到“@ angular / cli”。

Please take the following steps to avoid issues: "npm install --save-dev @angular/cli@latest" You seem to not be depending on "@angular/core". 请采取以下步骤以避免问题:“npm install --save-dev @ angular / cli @ latest”您似乎不依赖于“@ angular / core”。 This is an error. 这是一个错误。

in the backend(symfony) is run corretly but I had this error in angular js frontend when i want to run my server can someone have a idea why and how i solve 在后端(symfony)是正确运行但我在角js前端有这个错误当我想运行我的服务器时可以有人知道为什么以及我如何解决

This may happen if you aren't in you root directory of your application. 如果您不在应用程序的根目录中,则可能会发生这种情况。 This can happen if you created a new project with the command ng new project-name and then try to run serve command without actually entering the created project directory. 如果使用命令ng new project-name创建新项目,然后尝试运行serve命令而不实际输入创建的项目目录,则会发生这种情况。
1. Create a new project $ ng new project-name 1.创建一个新项目$ ng new project-name
2. Enter the project directory $ cd project-name 2.输入项目目录$ cd project-name
3. Only now run $ ng serve 3.现在只运行$ ng serve

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM