angular-cli: Angular 1.4.9 : Cannot read property 'NullLogger' of undefined
Angular/cli 4 - 1.4.9
Output from: ng --version
.
@angular/cli: 1.4.9
node: 8.9.4
os: win32 x64
Windows 10 - ver 1709(16299)
Repro steps
- Step 1 $ npm install -g @angular/cli@1.4.9
C:\Users\Owner\AppData\Roaming\npm\ng -> C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\bin\ng
uglifyjs-webpack-plugin@0.4.6 postinstall C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\node_modules\uglifyjs-webpack-plugin node lib/post_install.js
npm WARN @angular-devkit/schematics@0.0.51 requires a peer of @angular-devkit/core@0.0.28 but none is installed. You must install peer dependencies yourself. npm WARN @schematics/angular@0.0.49 requires a peer of @angular-devkit/schematics@0.0.34 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules@angular\cli\node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {“os”:“darwin”,“arch”:“any”} (current: {“os”:“win32”,“arch”:“x64”})
- @angular/cli@1.4.9 added 59 packages, removed 351 packages, updated 29 packages and moved 10 packages in 80.908s
- Step 2 $ ng new ang4test
Cannot read property ‘NullLogger’ of undefined TypeError: Cannot read property ‘NullLogger’ of undefined at SchematicEngine.createContext (C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular-devkit\schematics\src\engine\engine.js:64:39) at SchematicImpl.call (C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\node_modules@angular-devkit\schematics\src\engine\schematic.js:35:38) at Promise (C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\tasks\schematic-run.js:72:23) at new Promise (<anonymous>) at Class.run (C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\tasks\schematic-run.js:71:16) at Class.run (C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\tasks\init.js:71:33) at Class.run (C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\commands\new.js:133:25) at resolve (C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\models\command.js:261:20) at new Promise (<anonymous>) at Class.validateAndRun (C:\Users\Owner\AppData\Roaming\npm\node_modules@angular\cli\ember-cli\lib\models\command.js:240:12)
- Step 3
Observed behavior
All outputs shown above
Desired behavior
I expected new project to be made.
Mention any other details that might be useful (optional)
I’ve tried to install before many times. Installed and uninstalled, cleaned cache, but failed.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 6
- Comments: 19 (1 by maintainers)
I also faced the same issue but resolved by following this steps they will help you.
npm uninstall -g @angular/cli npm uninstall --save-dev @angular/cli npm cache clean npm install -g @angular/cli@latest npm install --save-dev @angular/cli@latest
it worked for me.
definitely angular sucks… sorry for posting this… but this can’t happen in two platforms today in 2018…
Can you try with 1.4.10?
Also seeing this issue:
ng g component MyComponent Your global Angular CLI version (1.6.5) is greater than your local version (1.4.1). The local Angular CLI version is used.
To disable this warning use “ng set --global warnings.versionMismatch=false”. Cannot read property ‘NullLogger’ of undefined TypeError: Cannot read property ‘NullLogger’ of undefined at SchematicEngine.createContext (/home/alan/NetBeansProjects/ums-gui-trunk/ums-gui-webapp/src/main/angular/node_modules/@angular-devkit/schematics/src/engine/engine.js:64:38) at SchematicImpl.call (/home/alan/NetBeansProjects/ums-gui-trunk/ums-gui-webapp/src/main/angular/node_modules/@angular-devkit/schematics/src/engine/schematic.js:35:38) at Promise (/home/alan/NetBeansProjects/ums-gui-trunk/ums-gui-webapp/src/main/angular/node_modules/@angular/cli/tasks/schematic-run.js:77:23) at Class.run (/home/alan/NetBeansProjects/ums-gui-trunk/ums-gui-webapp/src/main/angular/node_modules/@angular/cli/tasks/schematic-run.js:76:16) at Class.run (/home/alan/NetBeansProjects/ums-gui-trunk/ums-gui-webapp/src/main/angular/node_modules/@angular/cli/commands/generate.js:138:33) at resolve (/home/alan/NetBeansProjects/ums-gui-trunk/ums-gui-webapp/src/main/angular/node_modules/@angular/cli/ember-cli/lib/models/command.js:273:20) at Class.validateAndRun (/home/alan/NetBeansProjects/ums-gui-trunk/ums-gui-webapp/src/main/angular/node_modules/@angular/cli/ember-cli/lib/models/command.js:251:12) at Promise.resolve.then.then (/home/alan/NetBeansProjects/ums-gui-trunk/ums-gui-webapp/src/main/angular/node_modules/@angular/cli/ember-cli/lib/cli/cli.js:154:24) at process._tickCallback (internal/process/next_tick.js:109:7)
Just a question: why is this error occurring in cli versions older then 1.4.10?
@ulans2017 its=> npm install -g @angular/cli@1.4.10 Not => ng install -g @angular/cli@1.4.10
I just followed to suggestion and installed version 1.4.10 Please first uninstall all versions and clear the cache, and after install: ng install -g @angular/cli@1.4.10
The same error had happened to me, when
@angular/cli: 1.4.8
node: 8.10.0
After upgrading the angular CLI,
ng new newapp
worked fine.@angular/cli: 1.7.3
node:8.10.0
I m getting the same error tried to update the angular cli to latest one but still getting the same