Skip to content

Cannot Read Property 'glob' of null error #5808

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

Closed
ekaradev opened this issue Apr 3, 2017 · 22 comments
Closed

Cannot Read Property 'glob' of null error #5808

ekaradev opened this issue Apr 3, 2017 · 22 comments
Assignees
Labels
needs: more info Reporter must clarify the issue

Comments

@ekaradev
Copy link

ekaradev commented Apr 3, 2017

screenshot_3

@Malouke
Copy link

Malouke commented Apr 3, 2017

you have to install glob

@ekaradev
Copy link
Author

ekaradev commented Apr 3, 2017

@Malouke How do I install

@monaka
Copy link

monaka commented Apr 3, 2017

@emrekara37 same here and found this comment. #5580 (comment)
I'm waiting for the next release now.

@ekaradev
Copy link
Author

ekaradev commented Apr 4, 2017

@monaka
When will the new version be released

@Malouke
Copy link

Malouke commented Apr 4, 2017

hi emrekara
i think by this command npm install --save glob
the problem it s not clear with angular cli.

@ekaradev
Copy link
Author

ekaradev commented Apr 4, 2017

@Malouke glob is install but again error

@Malouke
Copy link

Malouke commented Apr 4, 2017

ok ,
if you allow me can I give another adivice work with github of angular-cli instead try to install it.
you can link with npm all steps are discribe under github of angular .

@ekaradev
Copy link
Author

ekaradev commented Apr 4, 2017

@Malouke
How to install GitHub repository for angular-cli

@Malouke
Copy link

Malouke commented Apr 4, 2017

git clone https://github.com/angular/angular-cli.git
cd angular-cli
npm link

ng new foo
cd foo
npm link @angular/cli
ng serve

@ekaradev ekaradev closed this as completed Apr 4, 2017
@ekaradev ekaradev reopened this Apr 4, 2017
@monaka
Copy link

monaka commented Apr 4, 2017

@emrekara37 I don't know when 1.0.1 will be released as I'm just a user. ;-)

@filipesilva
Copy link
Contributor

#5580 was released with 1.0.0, this issue sounds like something different.

@emrekara37 you seem to have an old app inside your app45 folder. Can you show me your angular-cli.json file?

@filipesilva filipesilva self-assigned this Apr 10, 2017
@filipesilva filipesilva added the needs: more info Reporter must clarify the issue label Apr 10, 2017
@Malouke
Copy link

Malouke commented Apr 10, 2017

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

@monaka
Copy link

monaka commented Apr 17, 2017

I'm not @emrekara37 but have similar issue.
Actually I'm running Deis but it uses buildpacks provided by Heroku.
Here is my package.json and the log on git push.

{
  "name": "pizzeria",
  "private": true,
  "version": "0.0.1",
  "description": "User console for PizzaFactory Camino",
  "main": "server.js",
  "scripts": {
    "ng": "ng",
    "start:dev": "ng serve",
    "start": "node server.js",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "postinstall": "ng build --base-href=/tavola --prod"
  },
  "private": true,
  "dependencies": {
    "body-parser": "^1.17.0",
    "compression": "^1.6.2",
    "express": "^4.14.1",
    "express-session": "^1.15.1",
    "morgan": "^1.8.1",
    "passport": "^0.3.2",
    "passport-azure-ad": "^3.0.4",
    "serve-static": "^1.12.0",
    "@angular/common": "^4.0.0",
    "@angular/compiler": "^4.0.0",
    "@angular/core": "^4.0.0",
    "@angular/forms": "^4.0.0",
    "@angular/http": "^4.0.0",
    "@angular/platform-browser": "^4.0.0",
    "@angular/platform-browser-dynamic": "^4.0.0",
    "@angular/router": "^4.0.0",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "1.0.0",
    "@angular/compiler-cli": "^4.0.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.5.0",
    "typescript": "~2.2.0"
  }
}
-----> Restoring cache...
       Done!
-----> Node.js app detected

-----> Creating runtime environment

       NPM_CONFIG_LOGLEVEL=error
       NPM_CONFIG_PRODUCTION=false
       NODE_ENV=development
       NODE_MODULES_CACHE=true

-----> Installing binaries
       engines.node (package.json):  unspecified
       engines.npm (package.json):   unspecified (use default)

       Resolving node version (latest stable) via semver.io...
       Downloading and installing node 7.9.0...
       Using default npm version: 4.2.0

-----> Restoring cache
       Loading 2 from cacheDirectories (default):
       - node_modules
       - bower_components (not cached - skipping)

-----> Building dependencies
       Installing node modules (package.json)

       > [email protected] postinstall /tmp/build
       > ng build --base-href=/tavola --prod

       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)
       at new ObjectSchemaTreeNode (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:209:14)
       at OneOfSchemaTreeNode._createChildProperty (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:148:26)
       at OneOfSchemaTreeNode._typesPrototype.schema.oneOf.map (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:161:25)
       at Array.map (native)
       at OneOfSchemaTreeNode (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:160:48)
       at ArraySchemaTreeNode._createChildProperty (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:148:26)
       at ArraySchemaTreeNode._set (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:286:39)
       at new ArraySchemaTreeNode (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:267:14)
       at ObjectSchemaTreeNode._createChildProperty (/tmp/build/node_modules/@ngtools/json-schema/src/schema-tree.js:148:26)

       npm ERR! Linux 4.10.4-coreos-r1
       npm ERR! argv "/tmp/build/.heroku/node/bin/node" "/tmp/build/.heroku/node/bin/npm" "install" "--unsafe-perm" "--userconfig" "/tmp/build/.npmrc"
       npm ERR! node v7.9.0
       npm ERR! npm  v4.2.0
       npm ERR! code ELIFECYCLE
       npm ERR! errno 1
       npm ERR! [email protected] postinstall: `ng build --base-href=/tavola --prod`
       npm ERR! Exit status 1
       npm ERR!
       npm ERR! Failed at the [email protected] postinstall script 'ng build --base-href=/tavola --prod'.
       npm ERR! Make sure you have the latest version of node.js and npm installed.
       npm ERR! If you do, this is most likely a problem with the pizzeria package,
       npm ERR! not with npm itself.
       npm ERR! Tell the author that this fails on your system:
       npm ERR!     ng build --base-href=/tavola --prod
       npm ERR! You can get information on how to open an issue for this project with:
       npm ERR!     npm bugs pizzeria
       npm ERR! Or if that isn't available, you can get their info via:
       npm ERR!     npm owner ls pizzeria
       npm ERR! There is likely additional logging output above.

       npm ERR! Please include the following file with any support request:
       npm ERR!     /app/.npm/_logs/2017-04-17T07_57_35_704Z-debug.log

-----> Build failed

@monaka
Copy link

monaka commented Apr 28, 2017

ping? Is more simplified example required?

@lafama
Copy link

lafama commented May 1, 2017

anyone with a fix for this? Am trying to deploy my app on dokku using a similar setup as @monaka

@kruczjak
Copy link

kruczjak commented May 1, 2017

Hi, I know that it's a bit hacky, but it works correctly (as workaround of course).

scripts part of mypackage.json:

  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "heroku-postbuild": "HOME=/ ./node_modules/@angular/cli/bin/ng build -prod -aot"
  },

Key thing is HOME=/. #4207 (comment)

@lafama
Copy link

lafama commented May 2, 2017

Works perfectly @kruczjak . Your a life saver 👍

@monaka
Copy link

monaka commented May 2, 2017

I also checked that my build was passed with the patch based @kruczjak 's information.
I become to implement my application with it for now. Thanks @kruczjak.
And I hope this issue will be fixed on the next release.

@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.

@filipesilva
Copy link
Contributor

I'm going to reopen #4207, it has a lot more context about this type of problem.

@kirillgroshkov
Copy link

@kruczjak your fix helped me!!

@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 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
needs: more info Reporter must clarify the issue
Projects
None yet
Development

No branches or pull requests

8 participants