I am new in angular2. I have downloaded angular 2 project and tried to setup. I installed angular cli 1.0.0-rc.2 and when I am doing ng serve it is showing the below error:
Cannot read property 'config' of null TypeError: Cannot read property 'config' of null at Class.run (D:\Sumit\AgulaNew\admin\node_modules\@angular\cli\tasks\serve.js:22:63) at check_port_1.checkPort.then.port (D:\Sumit\AgulaNew\admin\node_modules\@angular\cli\commands\serve.js:103:26) at at process._tickCallback (internal/process/next_tick.js:188:7)
I had the same error this morning.
You probably copied your project from one folder to another using Finder or Explorer. If so, the file .angular-cli.json
is missing.
If you are using a Mac, use the command ls -a
to list hidden files. You will notice that .angular-cli.json
will be there. Just copy the file to the new location and your problem will be solved.
I once git cloned a project where
ng -serve
failed.
This was because .angular-cli.json
was missing.
On the other and
npm start
did the job instead ;-)
Typically the project from angular tutorial webpack guide downloadable from webpack.zip confirms the case
Cannot read property 'config' of null
is a typical error when .angular-cli.json
is missing.
BTW you do not need any seed projects as a base
for your new app and there is no reason to use outdated angular cli 1.0.0-rc.2
as you mention.
Check the latest releases https://github.com/angular/angular-cli/releases or with npm show @angular/cli version
then install the latest npm install -g @angular/cli
and generate a new project with that. To see your local CLI version run ng -v
Also checkout the recent article The Past, Present, and Future of the Angular CLI by one of the core Angular team mebers @StephenFluin
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With