Vishal Srivastava
Vishal Srivastava

Reputation: 23

Angular-cli ng serve not working

Error is displaying when using ng serve or npm start command ,ng new is working.Previously it was working but now its not ,i have installed nodejs and angular-cli correctly.Thanks in advance. Error shown is:

Cannot read property 'glob' of null
TypeError: Cannot read property 'glob' of null
    at ObjectSchemaTreeNode._set (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:224:131)
    at new ObjectSchemaTreeNode (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:209:14)
    at OneOfSchemaTreeNode._createChildProperty (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at OneOfSchemaTreeNode._typesPrototype.schema.oneOf.map (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:161:25)
    at Array.map (native)
    at OneOfSchemaTreeNode (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:160:48)
    at ArraySchemaTreeNode._createChildProperty (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at ArraySchemaTreeNode._set (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:286:39)
    at new ArraySchemaTreeNode (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:267:14)
    at ObjectSchemaTreeNode._createChildProperty (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at ObjectSchemaTreeNode._set (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:224:45)
    at new ObjectSchemaTreeNode (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:209:14)
    at ArraySchemaTreeNode._createChildProperty (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at ArraySchemaTreeNode._set (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:286:39)
    at new ArraySchemaTreeNode (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:267:14)
    at RootSchemaTreeNode._createChildProperty (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:148:26)
    at RootSchemaTreeNode._set (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:224:45)
    at RootSchemaTreeNode.ObjectSchemaTreeNode (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:209:14)
    at RootSchemaTreeNode (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-tree.js:307:9)
    at GeneratedSchemaClass.SchemaClassBase (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-class-factory.js:53:29)
    at GeneratedSchemaClass (F:\projects\app1\node_modules\@ngtools\json-schema\src\schema-class-factory.js:144:13)
    at new CliConfig (F:\projects\app1\node_modules\@angular\cli\models\config\config.js:18:24)
    at Function.fromConfigPath (F:\projects\app1\node_modules\@angular\cli\models\config\config.js:81:16)
    at Function.fromProject (F:\projects\app1\node_modules\@angular\cli\models\config.js:90:46)
    at Object.<anonymous> (F:\projects\app1\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:\projects\app1\node_modules\@angular\cli\addon\index.js:15:16)
    at F:\projects\app1\node_modules\@angular\cli\ember-cli\lib\models\project.js:287:61
    at Array.forEach (native)
    at Project.addonCommands (F:\projects\app1\node_modules\@angular\cli\ember-cli\lib\models\project.js:286:15)
    at Project.eachAddonCommand (F:\projects\app1\node_modules\@angular\cli\ember-cli\lib\models\project.js:321:30)
    at module.exports (F:\projects\app1\node_modules\@angular\cli\ember-cli\lib\cli\lookup-command.js:33:13)
    at CLI.<anonymous> (F:\projects\app1\node_modules\@angular\cli\ember-cli\lib\cli\cli.js:46:26)
    at tryCatch (F:\projects\app1\node_modules\rsvp\dist\rsvp.js:538:12)
    at invokeCallback (F:\projects\app1\node_modules\rsvp\dist\rsvp.js:553:13)
    at publish (F:\projects\app1\node_modules\rsvp\dist\rsvp.js:521:7)
    at flush (F:\projects\app1\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)

Upvotes: 2

Views: 4925

Answers (4)

I know now that u need too own the rights on the directory not to have problem with sudo and install permissions. u won't need sudo. look at npm update also.

chown user:user /directory -> 4 ubuntu

Upvotes: 0

This 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 you own the directory (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

Upvotes: 0

Vishal Srinivasan
Vishal Srinivasan

Reputation: 109

I was facing same issue, I had run ng unit in system root directory by mistake. Once I had delete all the angular-cli files it was working

What I had done to resolve on windows-10 system.

  1. Open cmd.
  2. Run dir. (in Linux or mac its ls).
  3. If you find angular-cli files just delete.

And it's work for me.

Upvotes: 1

Atanas Korchev
Atanas Korchev

Reputation: 30661

Sounds like missing dependencies. Try removing node_modules and running npm install again.

Upvotes: 1

Related Questions