Skip to content

ng giving error when run inside an ng-cli generated project after the latest update! #7884

@SiddAjmera

Description

@SiddAjmera

Bug Report or Feature Request (mark with an x)

I updated to the latest version of AngularCLI and now, whenever I try to run ng inside an Angular Project generated using Angular CLI, it's giving me this error:

C:\DEV\Angular>cd MyFirstApp

C:\DEV\Angular\MyFirstApp>ng -v
C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:226
                this._children[name] = this._createChildProperty(name, value ? value[name] : undefined, forward ? forward.children[name] : null, propertySchema);
                                                                                                                                  ^

TypeError: Cannot read property 'glob' of null
    at ObjectSchemaTreeNode._set (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:226:131)
    at new ObjectSchemaTreeNode (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:211:14)
    at OneOfSchemaTreeNode._createChildProperty (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:150:26)
    at OneOfSchemaTreeNode._typesPrototype.schema.oneOf.map (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:163:25)
    at Array.map (native)
    at OneOfSchemaTreeNode (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:162:48)
    at ArraySchemaTreeNode._createChildProperty (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:150:26)
    at ArraySchemaTreeNode._set (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:288:39)
    at new ArraySchemaTreeNode (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:269:14)
    at ObjectSchemaTreeNode._createChildProperty (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:150:26)

C:\DEV\Angular\MyFirstApp>

Versions.

C:\DEV\Angular>ng -v
    _                      _                 ____ _     ___
   / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
  / ? \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
 / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
/_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
               |___/
@angular/cli: 1.4.4
node: 6.10.2
os: win32 x64

C:\DEV\Angular>

Repro steps.

I just tried to uninstall and reinstall Angular CLI using the following commands:

npm uninstall -g @angular/cli
npm cache clean
npm install -g @angular/cli@latest

I would like to emphasize on the fact that it's working as expected in a folders outside the ones generated by Angular CLI.

The log given by the failure.

C:\DEV\Angular\MyFirstApp>ng -v
C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:226
                this._children[name] = this._createChildProperty(name, value ? value[name] : undefined, forward ? forward.children[name] : null, propertySchema);
                                                                                                                                  ^

TypeError: Cannot read property 'glob' of null
    at ObjectSchemaTreeNode._set (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:226:131)
    at new ObjectSchemaTreeNode (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:211:14)
    at OneOfSchemaTreeNode._createChildProperty (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:150:26)
    at OneOfSchemaTreeNode._typesPrototype.schema.oneOf.map (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:163:25)
    at Array.map (native)
    at OneOfSchemaTreeNode (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:162:48)
    at ArraySchemaTreeNode._createChildProperty (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:150:26)
    at ArraySchemaTreeNode._set (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:288:39)
    at new ArraySchemaTreeNode (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:269:14)
    at ObjectSchemaTreeNode._createChildProperty (C:\DEV\Angular\MyFirstApp\node_modules\@ngtools\json-schema\src\schema-tree.js:150:26)

C:\DEV\Angular\MyFirstApp>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions