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

ng is not working

Open nmongiya opened this issue 9 years ago • 15 comments

Please provide us with the following information:

OS?

Windows 10

Versions.

Cannot read property 'input' of null TypeError: Cannot read property 'input' of null at ObjectSchemaTreeNode._set (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:347:132) at new ObjectSchemaTreeNode (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:331:14) at OneOfSchemaTreeNode.NonLeafSchemaTreeNode._createChildProperty (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:244:24) at C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:260:26 at Array.map (native) at new OneOfSchemaTreeNode (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:259:48) at ArraySchemaTreeNode.NonLeafSchemaTreeNode._createChildProperty (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:244:24) at ArraySchemaTreeNode._set (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:434:39) at new ArraySchemaTreeNode (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:414:14) at ObjectSchemaTreeNode.NonLeafSchemaTreeNode._createChildProperty (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:244:24) at ObjectSchemaTreeNode._set (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:347:47) at new ObjectSchemaTreeNode (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:331:14) at ArraySchemaTreeNode.NonLeafSchemaTreeNode._createChildProperty (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:244:24) at ArraySchemaTreeNode._set (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:434:39) at new ArraySchemaTreeNode (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:414:14) at RootSchemaTreeNode.NonLeafSchemaTreeNode._createChildProperty (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:244:24) at RootSchemaTreeNode.ObjectSchemaTreeNode._set (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:347:47) at RootSchemaTreeNode.ObjectSchemaTreeNode [as constructor] (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:331:14) at new RootSchemaTreeNode (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-tree.js:478:16) at GeneratedSchemaClass.SchemaClassBase (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-class-factory.js:66:29) at new GeneratedSchemaClass (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules@ngtools\json-schema\src\schema-class-factory.js:165:20) at new CliConfig (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\models\config\config.js:24:24) at Function.CliConfig.fromConfigPath (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\models\config\config.js:99:16) at Function.CliConfig.fromProject (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\models\config.js:63:44) at Object. (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\commands\serve.js:6:33) 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 (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\addon\index.js:23:16) at C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\models\project.js:317:61 at Array.forEach (native) at Project.addonCommands (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\models\project.js:316:15) at Project.eachAddonCommand (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\models\project.js:351:30) at module.exports (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\cli\lookup-command.js:33:13) at CLI. (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\cli\cli.js:42:26) at tryCatch (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules\rsvp\dist\rsvp.js:538:12) at invokeCallback (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules\rsvp\dist\rsvp.js:553:13) at publish (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\node_modules\rsvp\dist\rsvp.js:521:7) at flush (C:\Users\gkadmin\AppData\Roaming\npm\node_modules@angular\cli\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)

Repro steps.

npm -g uninstall @angular/cli npm cache clean npm -g install @angular/cli@latest ng new myNewApp (the myNewApp folder did not previously exist) cd myNewApp

try ng serve or ng --version

node -v .v6.9.5 npm -v 4.1.2 @angular/cli 1.0.0.30 beta

nmongiya avatar Feb 09 '17 06:02 nmongiya

I recommend you to install beta.21 and wait for beta.31. It is the only version working (partially) for me right now.

bertolo1988 avatar Feb 09 '17 12:02 bertolo1988

You omit quite a bit of information. Do your homework and provide more context. Starting with Repro steps containing your steps, not the tools versions.

Also, the issue title is not much of a help, it is too generic, more likely it gets ignored.

catull avatar Feb 09 '17 13:02 catull

What I did: npm -g uninstall @angular/cli npm cache clean npm -g install @angular/cli@latest ng new myNewApp (the myNewApp folder did not previously exist) cd myNewApp ng serve

Cannot read property 'input' of null TypeError: Cannot read property 'input' of null at ObjectSchemaTreeNode._set (D:\angular2Projects\publicdash\node_modules@ngtools\json-schema\src\schema-tree.js:226:131)

nmongiya avatar Feb 10 '17 03:02 nmongiya

When you use ng new nyNewAPP, is it working?

see2hao avatar Feb 10 '17 06:02 see2hao

yes ng new nyNewAPP is working

nmongiya avatar Feb 10 '17 07:02 nmongiya

I deleted all the node_modules, package.json in C:\Users\Administrator and C:\Users\Administrator\AppData\Roaming included folders npm and npm-cache. Then I unisntalled the nodejs,reinstalled nodejs ,rxjs, node-sass and @angluar/cli@latest. it`s working now.

see2hao avatar Feb 10 '17 09:02 see2hao

@nmongiya If it is working for you, please close the issue.

catull avatar Feb 10 '17 09:02 catull

its crashed if your use old nodejs version in OS.

If your OS ubuntu, use https://github.com/nodesource/distributions#deb

new angular/@cli requests nodejs ver. 6.9.x

I solve this problem use repo in link. Install to my ubuntu node 6.9 and all works fine!

pandalowry avatar Feb 12 '17 07:02 pandalowry

+1, I cant even get ng new to run

alexciesielski avatar Feb 18 '17 09:02 alexciesielski

Today I tried re-installing windows 10 then installed latest node and agular/cli but still getting error.

@angular/cli: 1.0.0-beta.32.3 node: 6.10.0 os: win32 x64

ng new is working but ng serve is giving below error

Cannot read property 'glob' of null TypeError: Cannot read property 'glob' of null at ObjectSchemaTreeNode._set (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:226:131) at new ObjectSchemaTreeNode (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:211:14) at OneOfSchemaTreeNode._createChildProperty (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:150:26) at OneOfSchemaTreeNode._typesPrototype.schema.oneOf.map (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:163:25) at Array.map (native) at OneOfSchemaTreeNode (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:162:48) at ArraySchemaTreeNode._createChildProperty (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:150:26) at ArraySchemaTreeNode._set (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:288:39) at new ArraySchemaTreeNode (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:269:14) at ObjectSchemaTreeNode._createChildProperty (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:150:26) at ObjectSchemaTreeNode._set (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:226:45) at new ObjectSchemaTreeNode (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:211:14) at ArraySchemaTreeNode._createChildProperty (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:150:26) at ArraySchemaTreeNode._set (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:288:39) at new ArraySchemaTreeNode (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:269:14) at RootSchemaTreeNode._createChildProperty (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:150:26) at RootSchemaTreeNode._set (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:226:45) at RootSchemaTreeNode.ObjectSchemaTreeNode (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:211:14) at RootSchemaTreeNode (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:309:9) at GeneratedSchemaClass.SchemaClassBase (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-class-factory.js:52:29) at GeneratedSchemaClass (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-class-factory.js:140:13) at new CliConfig (D:\newProjects\testAng\node_modules@angular\cli\models\config\config.js:17:24) at Function.fromConfigPath (D:\newProjects\testAng\node_modules@angular\cli\models\config\config.js:80:16) at Function.fromProject (D:\newProjects\testAng\node_modules@angular\cli\models\config.js:79:46) at Object. (D:\newProjects\testAng\node_modules@angular\cli\commands\build.js:5: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 (D:\newProjects\testAng\node_modules@angular\cli\addon\index.js:22:16) at D:\newProjects\testAng\node_modules@angular\cli\ember-cli\lib\models\project.js:287:61 at Array.forEach (native) at Project.addonCommands (D:\newProjects\testAng\node_modules@angular\cli\ember-cli\lib\models\project.js:286:15) at Project.eachAddonCommand (D:\newProjects\testAng\node_modules@angular\cli\ember-cli\lib\models\project.js:321:30) at module.exports (D:\newProjects\testAng\node_modules@angular\cli\ember-cli\lib\cli\lookup-command.js:33:13) at CLI. (D:\newProjects\testAng\node_modules@angular\cli\ember-cli\lib\cli\cli.js:42:26) at tryCatch (D:\newProjects\testAng\node_modules\rsvp\dist\rsvp.js:538:12) at invokeCallback (D:\newProjects\testAng\node_modules\rsvp\dist\rsvp.js:553:13) at publish (D:\newProjects\testAng\node_modules\rsvp\dist\rsvp.js:521:7) at flush (D:\newProjects\testAng\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)

nmongiya avatar Feb 24 '17 04:02 nmongiya

Dupe of https://github.com/angular/angular-cli/issues/4919, there's more information there.

filipesilva avatar Mar 09 '17 12:03 filipesilva

I had a look at the failing js module and found out there are still lots of bugs according to the follwing TypeError:

Cannot read property 'glob' of null TypeError: Cannot read property 'glob' of null at ObjectSchemaTreeNode._set (D:\newProjects\testAng\node_modules@ngtools\json-schema\src\schema-tree.js:226:131). I

Here's the reason and follows with a temporary fix: Line no. 223 if ( schema['properties'] ) always return TRUE even it has empty "{ }" object. Line no. 224 returns a null "input" then, Line no.225 tries to get a schema['properties'][null] <-- failed here

  • Here's my temporary fix (replace line 223 to 228 with these then, ng new name and ng --version will work ) 223 if (schema['properties'] != null && Object.keys(schema['properties']).length > 0) { 224 for (const name of Object.keys(schema['properties'])) { 225 if (Object.keys(schema['properties'])['input'] != null) { 226 const propertySchema = schema['properties'][name]; 227 this._children[name] = this._createChildProperty(name, value ? value[name] : undefined, forward ? forward.children[name] : n ull, propertySchema);} 228 } 229 }

senhleeic avatar Mar 09 '18 18:03 senhleeic

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 u own the directrory (" 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

magentall avatar Apr 30 '18 10:04 magentall

changing node from nvm fixed everything for me

danielokeyokoro avatar May 19 '18 20:05 danielokeyokoro

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.