angular-cli icon indicating copy to clipboard operation
angular-cli copied to clipboard

Cannot Read Property 'glob' of null error

Open ekaradev opened this issue 9 years ago • 22 comments

screenshot_3

ekaradev avatar Apr 03 '17 14:04 ekaradev

you have to install glob

Malouke avatar Apr 03 '17 15:04 Malouke

@Malouke How do I install

ekaradev avatar Apr 03 '17 15:04 ekaradev

@emrekara37 same here and found this comment. https://github.com/angular/angular-cli/issues/5580#issuecomment-288865297 I'm waiting for the next release now.

monaka avatar Apr 03 '17 23:04 monaka

@monaka
When will the new version be released

ekaradev avatar Apr 04 '17 07:04 ekaradev

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

Malouke avatar Apr 04 '17 07:04 Malouke

@Malouke glob is install but again error

ekaradev avatar Apr 04 '17 08:04 ekaradev

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 .

Malouke avatar Apr 04 '17 08:04 Malouke

@Malouke
How to install GitHub repository for angular-cli

ekaradev avatar Apr 04 '17 08:04 ekaradev

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

Malouke avatar Apr 04 '17 08:04 Malouke

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

monaka avatar Apr 04 '17 23:04 monaka

#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 avatar Apr 10 '17 16:04 filipesilva

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": {} } }

Malouke avatar Apr 10 '17 16:04 Malouke

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 avatar Apr 17 '17 08:04 monaka

ping? Is more simplified example required?

monaka avatar Apr 28 '17 19:04 monaka

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

lafama avatar May 01 '17 08:05 lafama

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=/. https://github.com/angular/angular-cli/issues/4207#issuecomment-277840301

kruczjak avatar May 01 '17 09:05 kruczjak

Works perfectly @kruczjak . Your a life saver 👍

lafama avatar May 02 '17 05:05 lafama

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.

monaka avatar May 02 '17 09:05 monaka

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.

balr404 avatar May 09 '17 23:05 balr404

I'm going to reopen https://github.com/angular/angular-cli/issues/4207, it has a lot more context about this type of problem.

filipesilva avatar May 10 '17 11:05 filipesilva