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

查看:97
本文介绍了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天全站免登陆