ng服务无法找到"@ angular/cli"在devDependencies中 [英] ng serve Unable to find "@angular/cli" in devDependencies

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

问题描述

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

$ ng serve Unable to find "@angular/cli" in devDependencies.

请采取以下步骤来避免出现问题:"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服务无法找到"@ angular/cli"在devDependencies中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆