Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

glob' of null when trying to build #4919

Closed
jathedok opened this issue Feb 22, 2017 · 17 comments
Closed

glob' of null when trying to build #4919

jathedok opened this issue Feb 22, 2017 · 17 comments

Comments

@jathedok
Copy link

Please provide us with the following information:

OS?

Linux 4.4.0-63-generic #84-Ubuntu SMP x86_64 x86_64 GNU/Linux

Versions.

@angular/cli: 1.0.0-beta.32.3
node: 7.6.0
os: linux x64
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/router: 3.4.8
@angular/cli: 1.0.0-beta.32.3
@angular/compiler-cli: 2.4.8

Repro steps.

ng build --env=prod

The log given by the failure.

TypeError: Cannot read property 'glob' of null
at ObjectSchemaTreeNode._set (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:226:131)
at new ObjectSchemaTreeNode (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:211:14)
at OneOfSchemaTreeNode._createChildProperty (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:150:26)
at OneOfSchemaTreeNode._typesPrototype.schema.oneOf.map (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:163:25)
at Array.map (native)
at OneOfSchemaTreeNode (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:162:48)
at ArraySchemaTreeNode._createChildProperty (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:150:26)
at ArraySchemaTreeNode._set (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:288:39)
at new ArraySchemaTreeNode (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:269:14)
at ObjectSchemaTreeNode._createChildProperty (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:150:26)
at ObjectSchemaTreeNode._set (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:226:45)
at new ObjectSchemaTreeNode (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:211:14)
at ArraySchemaTreeNode._createChildProperty (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:150:26)
at ArraySchemaTreeNode._set (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:288:39)
at new ArraySchemaTreeNode (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:269:14)
at RootSchemaTreeNode._createChildProperty (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:150:26)
at RootSchemaTreeNode._set (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:226:45)
at RootSchemaTreeNode.ObjectSchemaTreeNode (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:211:14)
at RootSchemaTreeNode (/app/node_modules/@ngtools/json-schema/src/schema-tree.js:309:9)
at GeneratedSchemaClass.SchemaClassBase (/app/node_modules/@ngtools/json-schema/src/schema-class-factory.js:52:29)
at GeneratedSchemaClass (/app/node_modules/@ngtools/json-schema/src/schema-class-factory.js:140:13)
at new CliConfig (/app/node_modules/@angular/cli/models/config/config.js:17:24)
at Function.fromConfigPath (/app/node_modules/@angular/cli/models/config/config.js:80:16)
at Function.fromProject (/app/node_modules/@angular/cli/models/config.js:79:46)
at Object. (/app/node_modules/@angular/cli/commands/build.js:5:35)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.require (module.js:498:17)
at require (internal/module.js:20:19)
at Class.includedCommands (/app/node_modules/@angular/cli/addon/index.js:22:16)
at /app/node_modules/@angular/cli/ember-cli/lib/models/project.js:287:61
at Array.forEach (native)
at Project.addonCommands (/app/node_modules/@angular/cli/ember-cli/lib/models/project.js:286:15)
at Project.eachAddonCommand (/app/node_modules/@angular/cli/ember-cli/lib/models/project.js:321:30)
at module.exports (/app/node_modules/@angular/cli/ember-cli/lib/cli/lookup-command.js:33:13)
at CLI. (/app/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:42:26)
at tryCatch (/app/node_modules/rsvp/dist/rsvp.js:538:12)
at invokeCallback (/app/node_modules/rsvp/dist/rsvp.js:553:13)
at publish (/app/node_modules/rsvp/dist/rsvp.js:521:7)
at flush (/app/node_modules/rsvp/dist/rsvp.js:2373:5)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
at process._tickCallback (internal/process/next_tick.js:98:9)

Mention any other details that might be useful.

Generated a new app using the CLI and did a deployment with dokku to digitalocean


Thanks! We'll be in touch soon.

@timelot
Copy link

timelot commented Feb 23, 2017

same error here after updating from angular-cli to angular/cli

@nmongiya
Copy link

same error here , I am using windows 10
@angular/cli: 1.0.0-beta.32.3
node: 6.10.0
os: win32 x64

@nmongiya
Copy link

Even ng serve is not working for me

@thomasdtucker
Copy link

I am having the exact same error. I have uninstalled node entirely. brew installed node again. And installed @angular/cli from scratch. I also tried downgrading versions of cli and it still happens.

What is going on?

@angular/cli: 1.0.0-beta.32.3
node: 7.5.0
os: darwin x64
@angular/cli: 1.0.0-beta.32.3
@angular/common: 2.4.8
@angular/compiler: 2.4.8
@angular/compiler-cli: 2.4.8
@angular/core: 2.4.8
@angular/forms: 2.4.8
@angular/http: 2.4.8
@angular/material: 2.0.0-beta.2
@angular/platform-browser: 2.4.8
@angular/platform-browser-dynamic: 2.4.8
@angular/platform-server: 2.4.8
@angular/router: 3.4.8

@Shirish-FrontEndDev
Copy link

I’m facing the same issue with @angular/cli 1.0.0-rc.0, and this is just angular/cli ng new app nothing fancy.

F:\TyVBShare\tychonSource\my-project>ng build --prod --aot
Cannot read property 'glob' of null
TypeError: Cannot read property 'glob' of null
    at ObjectSchemaTreeNode._set (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:224:131)
    at new ObjectSchemaTreeNode (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:209:14)
    at OneOfSchemaTreeNode._createChildProperty (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at OneOfSchemaTreeNode._typesPrototype.schema.oneOf.map (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:161:25)
    at Array.map (native)
    at OneOfSchemaTreeNode (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:160:48)
    at ArraySchemaTreeNode._createChildProperty (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at ArraySchemaTreeNode._set (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:286:39)
    at new ArraySchemaTreeNode (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:267:14)
    at ObjectSchemaTreeNode._createChildProperty (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at ObjectSchemaTreeNode._set (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:224:45)
    at new ObjectSchemaTreeNode (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:209:14)
    at ArraySchemaTreeNode._createChildProperty (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at ArraySchemaTreeNode._set (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:286:39)
    at new ArraySchemaTreeNode (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:267:14)
    at RootSchemaTreeNode._createChildProperty (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at RootSchemaTreeNode._set (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:224:45)
    at RootSchemaTreeNode.ObjectSchemaTreeNode (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:209:14)
    at RootSchemaTreeNode (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-tree.js:307:9)
    at GeneratedSchemaClass.SchemaClassBase (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-class-factory.js:53:29)
    at GeneratedSchemaClass (F:\TyVBShare\tychonSource\my-project\node_modules\@ngtools\json-schema\src\schema-class-factory.js:144:13)
    at new CliConfig (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\models\config\config.js:18:24)
    at Function.fromConfigPath (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\models\config\config.js:81:16)
    at Function.fromProject (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\models\config.js:76:46)
    at Object.<anonymous> (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\commands\build.js:7:35)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.require (module.js:497:17)
    at require (internal/module.js:20:19)
    at Class.includedCommands (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\addon\index.js:22:16)
    at F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\ember-cli\lib\models\project.js:287:61
    at Array.forEach (native)
    at Project.addonCommands (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\ember-cli\lib\models\project.js:286:15)
    at Project.eachAddonCommand (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\ember-cli\lib\models\project.js:321:30)
    at module.exports (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\ember-cli\lib\cli\lookup-command.js:33:13)
    at CLI.<anonymous> (F:\TyVBShare\tychonSource\my-project\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:46:26)
    at tryCatch (F:\TyVBShare\tychonSource\my-project\node_modules\rsvp\dist\rsvp.js:538:12)
    at invokeCallback (F:\TyVBShare\tychonSource\my-project\node_modules\rsvp\dist\rsvp.js:553:13)
    at publish (F:\TyVBShare\tychonSource\my-project\node_modules\rsvp\dist\rsvp.js:521:7)
    at flush (F:\TyVBShare\tychonSource\my-project\node_modules\rsvp\dist\rsvp.js:2373:5)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

F:\TyVBShare\tychonSource\my-project>cd ..

F:\TyVBShare\tychonSource>ng --version

@angular/cli: 1.0.0-rc.0
node: 6.9.4
os: win32 x64

F:\TyVBShare\tychonSource>

My .angular-cli.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "my-project"
  },
  "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": [
        "styles.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": {}
  }
}

and package.json

{
  "name": "my-project",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "^2.4.0",
    "@angular/compiler": "^2.4.0",
    "@angular/core": "^2.4.0",
    "@angular/forms": "^2.4.0",
    "@angular/http": "^2.4.0",
    "@angular/platform-browser": "^2.4.0",
    "@angular/platform-browser-dynamic": "^2.4.0",
    "@angular/router": "^3.4.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.7.6"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0-rc.0",
    "@angular/compiler-cli": "^2.4.0",
    "@types/jasmine": "2.5.38",
    "@types/node": "~6.0.60",
    "codelyzer": "~2.0.0",
    "jasmine-core": "~2.5.2",
    "jasmine-spec-reporter": "~3.2.0",
    "karma": "~1.4.1",
    "karma-chrome-launcher": "~2.0.0",
    "karma-cli": "~1.0.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "karma-coverage-istanbul-reporter": "^0.2.0",
    "protractor": "~5.1.0",
    "ts-node": "~2.0.0",
    "tslint": "~4.4.2",
    "typescript": "~2.0.0"
  }
}

@lafama
Copy link

lafama commented Mar 1, 2017

Anyone with a fix for this?

@intellix
Copy link
Contributor

intellix commented Mar 3, 2017

Debugging this a little. I'm also getting input of null when pushing an ng2 app. I'm only getting this when pushing to a Deis PaaS application but everything works when it's Heroku. I'm even using the same build pack but it's still not working.

I see that glob, input and output are all values of schema.json to do with the assets array for copying stuff over.

I've tried:

  • angular-cli rc.0 and 1
  • without AOT flag
  • having at least 1 file inside the assets folder for copying (as it was empty)
  • removing my project yarn.lock to enforce npm
  • copying the schema.json to the root of my project and referencing it inside .angular-cli.json
  • node 6 and 7
  • removing assets property entirely
  • removing assets folder and favicon.ico from assets property
  • renaming .angular-cli.json to angular-cli.json

Deleting the assets property entirely from .angular-cli.json gives me the input of null error so I guess that's why my ng2 project gets that error when pushing to Deis PaaS

It seems there are a couple of related issues: #4889 and #4207

My error, which may signify that it also doesn't work from /tmp/build:

Cannot read property 'glob' of null
       TypeError: Cannot read property 'glob' of null
       at ObjectSchemaTreeNode._set (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:224:131)

@Shirish-FrontEndDev
Copy link

Shirish-FrontEndDev commented Mar 3, 2017 via email

@filipesilva
Copy link
Contributor

In #4889 (comment), @huntsberg said:

It looks like #4207 is the same issue. If you set up the environment in your home directory, it fails. It's a common pattern in docker to put the app in the home directory.
Changing the home directory seems to resolve the issue.

@filipesilva
Copy link
Contributor

Dupe of #4207, especially relevant is #4207 (comment)

@balr404
Copy link

balr404 commented May 9, 2017

I have tried the following option to resolve the issue
Steps to resolve the issue

$ pwd
it shows —> /Users/YourName /*** That is your Home path***/
Execute the below command to display the hidden files

$ defaults write com.apple.Finder AppleShowAllFiles true
$ killall Finder
After executing the above command you will see the hidden files.
if “.angular-cli.json” file exist under “/Users/yourname” (i.e Home Path) then remove “.angular-cli.json” file.

then navigate to your application path and try execute ‘ng’ command.

1 similar comment
@balr404
Copy link

balr404 commented May 9, 2017

I have tried the following option to resolve the issue
Steps to resolve the issue

$ pwd
it shows —> /Users/YourName /*** That is your Home path***/
Execute the below command to display the hidden files

$ defaults write com.apple.Finder AppleShowAllFiles true
$ killall Finder
After executing the above command you will see the hidden files.
if “.angular-cli.json” file exist under “/Users/yourname” (i.e Home Path) then remove “.angular-cli.json” file.

then navigate to your application path and try execute ‘ng’ command.

@cctv549681
Copy link

@balr404 thanks ,it works

@kirillgroshkov
Copy link

Still doesn't work for me!

@magentall
Copy link

magentall commented Apr 30, 2018

works for me on 1.3.1 i also change the dev in the package from angular/cli 131 to angular cli 1.7.4 (may be optional)

verify that u own the directrory (" chown groupe:user directory " on ubuntu) and try root launch for the ng (sudo)

or / and
remove the node dir and -lock.json, run npm i and launch or sudo launch ng

@magentall
Copy link

magentall commented Jun 25, 2018

Try sudo of ur ng first, not to have to have to reinstall if not necessary
im on debian 9.4

@angular-automatic-lock-bot
Copy link

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.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Sep 8, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests