0
votes

Every time I try to launch my project I get this error:

$ ng serve

Your global Angular CLI version (1.7.3) is greater than your local version (1.6.8). The local Angular CLI version is used.

To disable this warning use "ng set --global warnings.versionMismatch=false".

Cannot read property 'config' of null

TypeError: Cannot read property 'config' of null at Class.run (D:\Projekte\Advanced-ban\webinterface\node_modules\@angular\cli\tasks\serve.js:51:63) at check_port_1.checkPort.then.port (D:\Projekte\Advanced-an\webinterface\node_modules\@angular\cli\commands\serve.js:123:26) at at process._tickCallback (internal/process/next_tick.js:188:7)

2
The error message is pretty clear: make local and global version the same. - Henry
Read the error message. Make the versions the same or disable the warning exactly as stated in the error message. - Igor
check on which class you have defined config property and check its initialized or not - Pranay Rana
just for your info, please start accepting answers which resolve your isssue : meta.stackexchange.com/questions/5234/… - Pranay Rana

2 Answers

0
votes

The first on is warning .. to remove it follow update guid : https://github.com/angular/angular-cli#updating-angular-cli

Your global Angular CLI version (1.7.3) is greater than your local version (1.6.8). The local Angular CLI version is used.

npm uninstall --save-dev angular-cli
npm install --save-dev @angular/cli@latest

second one its error which is not related to first one

Cannot read property 'config' of null

TypeError: Cannot read property 'config' of null at Class.run (D:\Projekte\Advanced-ban\webinterface\node_modules\@angular\cli\tasks\serve.js:51:63) at check_port_1.checkPort.then.port (D:\Projekte\Advanced-an\webinterface\node_modules\@angular\cli\commands\serve.js:123:26) at at process._tickCallback (internal/process/next_tick.js:188:7)

which says that, you are reading config property of class which is not intialized. which means you class is in undefiend/null state. to make it work you need to initialize class

0
votes

You only need to install the specific version of CLI with respect to the project you installed.

npm install -g @angular/[email protected]