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

Created on 29 Sep 2017  路  6Comments  路  Source: angular/angular-cli

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>
more info

Most helpful comment

Check path C:\USERS{Computer-name}
I had same issue. went as far as re-installing node. But what fixed it for me was deleting a ".angular-cli.json" file i found in that directory

All 6 comments

Can you try reinstalling in your local projects?
Ideally upgrading your local project to the latest version as well, and then retrying.

Thanks!

@Brocco , I created the project after uninstalling and reinstalling AngularCLI. So ideally my project should have the same version as my global version which is the latest version. Please do correct me if I'm wrong.

Thanks!

Check path C:\USERS{Computer-name}
I had same issue. went as far as re-installing node. But what fixed it for me was deleting a ".angular-cli.json" file i found in that directory

Are you still able to reproduce this issue with the latest version?

Thanks for reporting this issue. However, you didn't provide sufficient information for us to understand and reproduce the problem. Please check out our submission guidelines to understand why we can't act on issues that are lacking important information.

If the problem persists, please file a new issue and ensure you provide all of the required information when filling out the issue template.

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

Was this page helpful?
0 / 5 - 0 ratings