使用Angular CLI创建Angular2应用程序时无法更改任何内容 [英] Not able to change anything in Angular2 application when i create it using Angular CLI

查看:92
本文介绍了使用Angular CLI创建Angular2应用程序时无法更改任何内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用ng serve项目在localhost中运行,但是更改代码后,它不会刷新.

Using ng serve the project runs in localhost but after changing the code it does not refresh.

让我们说我们拥有通用的"App Works !!".在最初的项目中.但是,如果我在application.component.ts内部将应用程序正常工作"编辑为你好",它不会改变.它仍然显示App Works!

Lets say we have the general "App Works!!" in the initial project. However, it doesn't change if I edit inside the application.component.ts the "App works" to "Hello". It still shows App Works!!

出了什么问题.帮帮我.

what's the problem. Help me out.

推荐答案

这是angular-cli使用的最新@ngtools/webpack软件包中的错误.要解决此问题,您需要手动将软件包降级:

This is a bug within the latest @ngtools/webpack package that the angular-cli uses. To fix this you need to manually downgrade the package:

npm uninstall @ngtools/webpack
npm install --save-dev @ngtools/webpack@1.2.4

在新的cli版本之后,您应该再次从package.json中删除此

After a new cli version, you should remove this from your package.json again

有关更多信息,请查看错误报告

For more information check this bug report

这篇关于使用Angular CLI创建Angular2应用程序时无法更改任何内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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