Hi everyone,
Error while "ng serve" :
Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
at Class.run (/mn/Mobile App Source/node_modules/@angular/cli/tasks/serve.js:51:63)
at check_port_1.checkPort.then.port (/mn/Mobile App Source/node_modules/@angular/cli/commands/serve.js:123:26)
at process._tickCallback (internal/process/next_tick.js:109:7)
Version :
node : v6.11.0
npm : 5.5.1
ionic : 2.2.1
Angular CLI: 1.5.0
Node: 6.11.0
OS: darwin x64 : MacOS : 10.13 (17A365)
Angular: 2.4.8
... common, compiler, compiler-cli, core, forms, http
... platform-browser, platform-browser-dynamic, platform-server
@ angular/cli: 1.5.0
@ angular-devkit/build-optimizer: 0.0.32
@ angular-devkit/core: 0.0.20
@ angular-devkit/schematics: 0.0.35
@ ngtools/json-schema: 1.1.0
@ ngtools/webpack: 1.8.0
@ schematics/angular: 0.1.0
typescript: 2.2.2
webpack-sources: 1.0.2
webpack: 3.8.1
I don't have ".angular-cli.json" in my project directory, Is it normal?
I tried npm install or npm install --save-dev @angular/cli@latest or removing node_modules many times, But noting changed.
Can anyone help me?
Thanks
I had the same problem you need a .angular-cli.json file. I just copied an angular-cli.json file from a previous project and changed the version in it and BOOM works like a charm!
@theparmis Can you confirm whether the suggestion from @chrisformula has solved your issue?
Can you give .angular-cli.json file? I can't find this file at all.
Thanks
Just create a .angular-cli.json file and copy and paste this in it and it runs perfect.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"version": "1.0.0-alpha.6",
"name": "coreui-angular"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": ["assets"],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"scss/style.scss"
],
"scripts": [
"../node_modules/chart.js/dist/Chart.bundle.min.js",
"../node_modules/chart.js/dist/Chart.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"prefixInterfaces": false
}
}
I'm sorry, but we can't reproduce the problem following the instructions you provided.
Remember that we have a large number of issues to resolve, and have only a limited amount of time to reproduce your issue.
Short, explicit instructions make it much more likely we'll be able to reproduce the problem so we can fix it.
If the problem persists, please open a new issue following our submission guidelines.
A good way to make a minimal repro is to create a new app via ng new repro-app and adding the minimum possible code to show the problem. Then you can push this repository to github and link it here.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
Just create a .angular-cli.json file and copy and paste this in it and it runs perfect.
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"version": "1.0.0-alpha.6",
"name": "coreui-angular"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": ["assets"],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"scss/style.scss"
],
"scripts": [
"../node_modules/chart.js/dist/Chart.bundle.min.js",
"../node_modules/chart.js/dist/Chart.min.js"
],
"environmentSource": "environments/environment.ts",
"environments": {
"dev": "environments/environment.ts",
"prod": "environments/environment.prod.ts"
}
}
],
"e2e": {
"protractor": {
"config": "./protractor.conf.js"
}
},
"lint": [
{
"project": "src/tsconfig.app.json"
},
{
"project": "src/tsconfig.spec.json"
},
{
"project": "e2e/tsconfig.e2e.json"
}
],
"test": {
"karma": {
"config": "./karma.conf.js"
}
},
"defaults": {
"styleExt": "scss",
"prefixInterfaces": false
}
}