本文介绍了ng serve 无法找到“@angular/cli"在开发依赖中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

$ ng serve 无法在 devDependencies 中找到@angular/cli".

请采取以下步骤以避免出现问题:npm install--save-dev @angular/cli@latest" 你似乎不依赖 "@angular/core".这是一个错误.

Please take the following steps to avoid issues: "npm install --save-dev @angular/cli@latest" You seem to not be depending on "@angular/core". This is an error.

在后端(symfony)正确运行,但是当我想运行我的服务器时,我在 angular js 前端遇到了这个错误,有人可以知道我为什么以及如何解决

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

推荐答案

如果您不在应用程序的根目录中,则可能会发生这种情况.如果您使用命令 ng new project-name 创建了一个新项目,然后尝试在没有实际进入创建的项目目录的情况下运行 serve 命令,就会发生这种情况.
1.新建项目$ng new project-name
2.进入项目目录$cd project-name
3. 现在才运行$ ng serve

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.
1. Create a new project $ ng new project-name
2. Enter the project directory $ cd project-name
3. Only now run $ ng serve

这篇关于ng serve 无法找到“@angular/cli"在开发依赖中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-27 12:25