Angular 2 无法读取 null 的属性“config" [英] Angular 2 Cannot read property 'config' of null

查看:28
本文介绍了Angular 2 无法读取 null 的属性“config"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 Angular 2 时遇到问题.当我想启动服务器时,它会得到这个:

I have a issue with Angular 2. When i want to start server it get this:

$ ng serve
Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
at Class.run (C:\Users\Damien\Desktop\application\node_modules\@angul ar\cli\tasks\serve.js:22:63)
at check_port_1.checkPort.then.port (C:\Users\Damien\Desktop\application\node_modules\@angular\cli\commands\serve.js:103:26)
at process._tickCallback (internal/process/next_tick.js:103:7)

我重新安装了 CLI,但没有其他任何工作.我可能是 json 文件的东西?

I reinstalled CLI and nothing else is working. I could be something with json file?

推荐答案

我找到了解决方案!就我而言,我将项目移至另一个目录.
有一个名为 .angular-cli
的隐藏文件显示旧项目中的隐藏文件并复制此文件并将其粘贴到新项目中.这为我解决了这个问题.

I found the solution! In my case I moved the project to another directory.
there is a hidden file called .angular-cli
Show the hidden file in the old project and copy this file and paste it in the new distention. This solved the issue for me.

这篇关于Angular 2 无法读取 null 的属性“config"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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