Failing when i execute "ng serve"
@angular/cli: 1.0.2
What ever node version(node: 7.7.4) i install i am getting this error. Can some one help to fix this issue. I am completely blocked with this issue.
TypeError: Cannot read property 'glob' of null
at ObjectSchemaTreeNode._set (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:224:131)
at new ObjectSchemaTreeNode (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:209:14)
at OneOfSchemaTreeNode._createChildProperty (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:148:26)
at OneOfSchemaTreeNode._typesPrototype.schema.oneOf.map (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:161:25)
at Array.map (native)
at OneOfSchemaTreeNode (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:160:48)
at ArraySchemaTreeNode._createChildProperty (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:148:26)
at ArraySchemaTreeNode._set (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:286:39)
at new ArraySchemaTreeNode (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:267:14)
at ObjectSchemaTreeNode._createChildProperty (/usr/local/lib/node_modules/@angular/cli/node_modules/@ngtools/json-schema/src/schema-tree.js:148:26)
Version
@angular/cli: 1.0.2
node: 7.7.4
os: darwin x64
npm : 4.1.2
{
"$schema": "./node_modules/@angular/cli/lib/config/schema.json",
"project": {
"name": "my-app"
},
"apps": [
{
"root": "src",
"outDir": "dist",
"assets": [
"assets",
"favicon.ico"
],
"index": "index.html",
"main": "main.ts",
"polyfills": "polyfills.ts",
"test": "test.ts",
"tsconfig": "tsconfig.app.json",
"testTsconfig": "tsconfig.spec.json",
"prefix": "app",
"styles": [
"../node_modules/bootstrap/dist/css/bootstrap.min.css",
"../node_modules/font-awesome/css/font-awesome.css"
],
"scripts": [],
"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": "css",
"component": {}
}
}
{
"name": "my-app",
"version": "1.0.0",
"description": "QuickStart package.json from the documentation, supplemented with testing support",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e",
"i18n": "ng-xi18n"
},
"private": true,
"keywords": [],
"author": "",
"license": "MIT",
"dependencies": {
"@angular/animations": "^4.1.0",
"@angular/common": "^4.1.0",
"@angular/compiler": "^4.1.0",
"@angular/compiler-cli": "^4.1.0",
"@angular/core": "^4.1.0",
"@angular/flex-layout": "2.0.0-beta.8",
"@angular/forms": "^4.1.0",
"@angular/http": "^4.1.0",
"@angular/material": "^2.0.0-beta.3",
"@angular/platform-browser": "^4.1.0",
"@angular/platform-browser-dynamic": "^4.1.0",
"@angular/platform-server": "^4.1.0",
"@angular/router": "^4.1.0",
"@ngx-translate/core": "^6.0.1",
"@ngx-translate/http-loader": "0.0.3",
"@types/underscore": "^1.8.0",
"angular-2-local-storage": "^1.0.1",
"bootstrap": "^3.3.7",
"core-js": "^2.4.1",
"font-awesome": "^4.7.0",
"hammerjs": "^2.0.8",
"ng2-validation": "^4.1.0",
"ngx-infinite-scroll": "^0.5.1",
"rxjs": "^5.3.0",
"underscore": "^1.8.3",
"zone.js": "^0.8.5"
},
"devDependencies": {
"@angular/cli": "^1.0.2",
"@angular/compiler-cli": "^4.1.0",
"@types/jasmine": "~2.5.38",
"@types/node": "^7.0.8",
"codelyzer": "~3.0.1",
"jasmine-core": "~2.6.1",
"jasmine-spec-reporter": "~4.1.0",
"karma": "~1.6.0",
"karma-chrome-launcher": "~2.0.0",
"karma-cli": "~1.0.1",
"karma-coverage-istanbul-reporter": "^1.2.1 ",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"karma-phantomjs-launcher": "^1.0.4",
"protractor": "~5.1.1",
"ts-node": "~3.0.2",
"tslint": "~5.1.0",
"typescript": "~2.3.2"
},
"repository": {}
}
Heya, do you maybe have an old angular-cli.json or .angular-cli.json in your user folder?
Hi filipesilva,
I have it '.angular-cli.json'. When i create the new application ,
For example
step 1: ng new 'my-app' // it is working (
step 2: i navigate to the path 'my-app'. Did 'npm install'
step 3: ng serve // it is throwing same error Cannot read property "glob" of null
Note:
goto 'my-app' applicaiton path and try to execute 'ng' command is not working
my-app user$ ng //// it is throwing same error Cannot read property "glob" of null
Appreciate your help. Most of the people are suffering becoz of this issue.
Thanks
I have tried the following option to resolve the issue
Steps to resolve the issue
Execute the below command to display the hidden files
After executing the above command you will see the hidden files.
if “.angular-cli.json” file exists under “/Users/YourName” (i.e Home Path) then remove “.angular-cli.json” file.
then navigate to your application path and try execute ‘ng’ command.
I'm going to reopen #4207, it has a lot more context about this type of problem. Please subscribe to that issue to get updates.
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
Heya, do you maybe have an old
angular-cli.jsonor.angular-cli.jsonin your user folder?