TypeError: Cannot read property 'config' of null
Please provide us with the following information:
OS?
Windows 7
Versions.
Please run
ng --version. If there's nothing outputted, please run in a Terminal:node --versionand paste the result here:
@angular/cli: 1.0.0-beta.31
node: 6.9.4
os: win32 x64
@angular/cli: 1.0.0-beta.31
@angular/common: 2.2.4
@angular/compiler: 2.2.4
@angular/compiler-cli: 2.4.7
@angular/core: 2.4.7
@angular/forms: 2.2.4
@angular/http: 2.2.4
@angular/platform-browser: 2.2.4
@angular/platform-browser-dynamic: 2.2.4
@angular/router: 3.2.4
@angular/upgrade: 2.2.4
Repro steps.
Was this an app that wasn't created using the CLI? What change did you do on your code? etc.
Added cli later and did ng init
The log given by the failure.
Normally this include a stack trace and some more information.
ng build --prod --verbose
Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
at Class.run (C:\Projects\Someplace\Portal\Someplace\node_modules\@angular\cli\tasks\build.js:14:89)
at Class.run (C:\Projects\Someplace\Portal\Someplace\node_modules\@angular\cli\commands\build.js:49:26)
at Class.<anonymous> (C:\Projects\Someplace\Portal\Someplace\node_modules\@angular\cli\ember-cli\lib\models\command.js:134:17)
at process._tickCallback (internal/process/next_tick.js:103:7)
Mention any other details that might be useful.
The offending line
const outputPath = runTaskOptions.outputPath || config_1.CliConfig.fromProject().config.apps[0].outDir;
Thanks! We'll be in touch soon.
These responses helped me identify the solution. I have an older version of angular, and I pulled teammates code and got this error.
In my project root I had _angular-cli.json - I changed it to .angular-cli.json and it worked!
I had same problem with @angular/cli: 1.0.0 node: 6.10.3 os: win32 x64
first i tried with command "ng init" and ng build. It didn't worked. In my case I just restarted the "Visual Studio code" it worked.
@soodvarun @ardiadrianadri @bougnat12 @jdschmitt @dpalita
Guys first of all try to check whether the the given file is there or not in the below project specified path. file name : .angular-cli.json note :
- This .angular-cli.json file should must be there. It should be .angular-cli.json only,not like (_ angular-cli.json) or anything else.
Check the screenshot :+1:

The reason why it is showing error is basically due to above two mentioned points :

I hope it may help you guys!! :+1: :-)
It was caused due to missing .angular-cli.json as I created my repo in Linux environment and then was trying to run it in the windows environment by cloning the repo.
Got same issue. Cause of this error: Copying project files from old directory to another directory, .angular-cli.json not copied. Solved: By copying .angular-cli.json file from old project directory to new one. Project building successfully.
Got the same issue today. macOS Sierra (10.12.6) Node v9.4.0 ngCli 1.6.5
Pulled a 3 month old NG app from a repo.
Fix: I created a new App using "ng new foo" and copied the .angular-cli.json file form the new project into the cloned existing one.
Same issue. I solved by this one: https://stackoverflow.com/questions/45207900/how-to-generate-angular-cli-json-file-in-angular-cli
Hit the same issue as @narendrasinghrathore @django18, due to missing .angular-cli.json (when copying on macosx finder these .abc files are not visible). Copying the file manually resolved this issue.
My solution was embarrassingly simple: First, make sure you are in the correct directory before trying to use "ng serve".
My solution is to delete my app folder and recreate using "ng new".
First time I created the app, the download of NPM modules was slow and I switched by networks - later I cancelled the ng new and re-ran it withouth cleaning the dirs. That caused the issue for me. So, deleting the app directory and re-creating the app solved my issue.
This was on Windows
in my case there is a hidden file called .angular-cli.json just remove . from it name to be angular-cli.json
This happened to me because I renamed the project/repo/everything, but forgot to rename the project name in .angular-cli.json. After I fixed it there, it worked just fine.
Happened to me uploading a repo from windows to an online drive.
Made a new app and copped over the missing files.
I had the same error when I tried to run ng test. The solution was easy. I was located in wrong directory. I had to cd one level deeper, where all my files were located.
hello guys, I think this is the simple problem we are ignored: in this case, when I moved the project one directory to another directory there is some hidden file called like::::::".angular-cli ", ".editorconfig". show the hidden file in the old project and copy this file and past it in the new distention. this is solved the issue for me. or any other angular project or create a new project then copy the hidden file and past it in the new destination
Same here. I copied to a new directory using cp -r command where it did not copy .angular-cli.json file which is a hidden file. if your machine is unix/mac then run this command on your source folder to find the .angular-cli.json . after copying to the destination folder it worked like charm.
ls -ltr A command should show hidden files.
@anandbabud1987 Your solution worked for me. I really appreciate your way. Thanks a lot, mate
@HDaghash, Thanks! copying .angular-cli.json from an old project to the new worked perfect
if you have this
_angular-cli.json
rename it to this
.angular-cli.json
The 'Cannot read property 'config' of null' was came after i did git checkout new branch. Please do once the 'npm install'. The error got cleared for me. Now I can do 'ng serve' normally. Thanks !