when i run 'ng serve' ,it shows 'Can't read property 'config of null'.
package.json:
{
"name": "@angular/cli-1",
"version": "1.0.0",
"description": "CLI tool for Angular",
"main": "packages/@angular/cli/lib/cli/index.js",
"trackingCode": "UA-8594346-19",
"bin": {
"ng": "./bin/ng"
},
"keywords": [],
"scripts": {
"build": "node scripts/run-tool.js publish build",
"test": "npm-run-all -c test:packages test:cli test:deps test:licenses test:messages",
"e2e": "npm run test:e2e",
"e2e:nightly": "node tests/run_e2e.js --nightly",
"test:e2e": "node tests/run_e2e.js",
"test:cli": "node tests/runner",
"test:deps": "node scripts/publish/validate_dependencies.js",
"test:inspect": "node --inspect --debug-brk tests/runner",
"test:licenses": "node scripts/test-licenses.js",
"test:messages": "node scripts/test-commit-messages.js",
"test:packages": "node scripts/run-packages-spec.js",
"eslint": "eslint .",
"tslint": "tslint \"/.ts\" -c tslint.json -e \"/config/schema.d.ts\" -e \"/tests/\" -e \"/blueprints//files//.ts\" -e \"node_modules/\" -e \"tmp/\" -e \"dist/*\"",
"lint": "npm-run-all -c eslint tslint",
"tool": "node scripts/run-tool.js"
},
"repository": {
"type": "git",
"url": "https://github.com/angular/angular-cli.git"
},
"engines": {
"node": ">= 6.9.0",
"npm": ">= 3.0.0"
},
"author": "Angular Authors",
"license": "MIT",
"bugs": {
"url": "https://github.com/angular/angular-cli/issues"
},
"homepage": "https://github.com/angular/angular-cli",
"dependencies": {
"autoprefixer": "^6.5.3",
"chalk": "^1.1.3",
"common-tags": "^1.3.1",
"css-loader": "^0.27.3",
"cssnano": "^3.10.0",
"debug": "^2.1.3",
"denodeify": "^1.2.1",
"diff": "^3.1.0",
"ember-cli-normalize-entity-name": "^1.0.0",
"ember-cli-string-utils": "^1.0.0",
"enhanced-resolve": "^3.1.0",
"exports-loader": "^0.6.3",
"extract-text-webpack-plugin": "^2.1.0",
"file-loader": "^0.10.0",
"fs-extra": "~2.0.0",
"get-caller-file": "^1.0.0",
"glob": "^7.0.3",
"html-webpack-plugin": "^2.19.0",
"inflection": "^1.7.0",
"inquirer": "^3.0.0",
"isbinaryfile": "^3.0.0",
"istanbul-instrumenter-loader": "^2.0.0",
"json-loader": "^0.5.4",
"karma-sourcemap-loader": "^0.3.7",
"karma-webpack": "^2.0.0",
"less": "^2.7.2",
"less-loader": "^4.0.2",
"loader-utils": "^1.0.2",
"lodash": "^4.11.1",
"magic-string": "^0.19.0",
"minimatch": "^3.0.3",
"node-modules-path": "^1.0.0",
"nopt": "^4.0.1",
"opn": "4.0.2",
"portfinder": "~1.0.12",
"postcss-loader": "^1.3.3",
"postcss-url": "^5.1.2",
"raw-loader": "^0.5.1",
"resolve": "^1.1.7",
"rimraf": "^2.5.3",
"rsvp": "^3.0.17",
"rxjs": "^5.0.1",
"sass-loader": "^6.0.3",
"script-loader": "^0.7.0",
"semver": "^5.3.0",
"silent-error": "^1.0.0",
"source-map": "^0.5.6",
"source-map-loader": "^0.1.5",
"style-loader": "^0.13.1",
"stylus": "^0.54.5",
"stylus-loader": "^3.0.1",
"temp": "0.8.3",
"typescript": "~2.2.0",
"url-loader": "^0.5.7",
"walk-sync": "^0.3.1",
"webpack": "~2.2.0",
"webpack-dev-server": "~2.4.2",
"webpack-merge": "^2.4.0",
"zone.js": "^0.8.4"
},
"ember-addon": {
"paths": [
"./packages/@angular/cli/lib/addon"
]
},
"devDependencies": {
"@angular/cli": "^1.0.0",
"@angular/compiler": "^4.0.0",
"@angular/compiler-cli": "^4.0.0",
"@angular/core": "^4.0.0",
"@types/chai": "^3.4.32",
"@types/chalk": "^0.4.28",
"@types/common-tags": "^1.2.4",
"@types/denodeify": "^1.2.29",
"@types/express": "^4.0.32",
"@types/fs-extra": "0.0.37",
"@types/glob": "^5.0.29",
"@types/jasmine": "~2.2.0",
"@types/lodash": "4.14.50",
"@types/minimist": "^1.2.0",
"@types/mock-fs": "^3.6.30",
"@types/node": "^6.0.36",
"@types/request": "0.0.39",
"@types/rimraf": "0.0.28",
"@types/semver": "^5.3.30",
"@types/source-map": "^0.5.0",
"@types/webpack": "^2.2.4",
"chai": "^3.5.0",
"conventional-changelog": "^1.1.0",
"dtsgenerator": "^0.9.1",
"eslint": "^3.11.0",
"exists-sync": "0.0.4",
"express": "^4.14.0",
"jasmine": "^2.4.1",
"jasmine-spec-reporter": "^3.2.0",
"minimist": "^1.2.0",
"mocha": "^3.2.0",
"mock-fs": "^4.0.0",
"npm-run": "^4.1.0",
"npm-run-all": "^4.0.0",
"object-assign": "^4.0.1",
"request": "^2.74.0",
"resolve-bin": "^0.4.0",
"rewire": "^2.5.1",
"sinon": "^1.17.3",
"spdx-satisfies": "^0.1.3",
"through": "^2.3.6",
"tree-kill": "^1.0.0",
"ts-node": "^2.0.0",
"tslint": "^4.0.2"
},
"optionalDependencies": {
"node-sass": "^4.3.0"
}
}
i found the solution ! :D
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 past it in the new distention .
this is solved the issue for me .
Still i am getting same error.solution by @HDaghash not works
Cannot read property 'config' of null
TypeError: Cannot read property 'config' of null
at Class.run (/home/webwerks2/pravin/neo-projects/interview_panel/node_modules/@angular/cli/tasks/build.js:16:56)
at Class.run (/home/webwerks2/pravin/neo-projects/interview_panel/node_modules/@angular/cli/commands/build.js:143:26)
at Class.
at process._tickCallback (internal/process/next_tick.js:103:7)
i think the problem is because there is a missing file which is .angular-cli.json which you should include in your folder before you run ng-serve
Where is this .angular-cli.json normally located? I am using a Mac. Did a Command + Shift + Period to find hidden files but can't locate .angular-cli.json
@weikee94 is right after insert angular-cli.json everything is working again.
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
i found the solution ! :D
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 past it in the new distention .
this is solved the issue for me .