Angular – TypeError: Cannot read property 'write' of undefined

  • A+
Category:Languages

I'm working on a club project and we are using angular for our platform, I'm just doing front-end homepage stuff, so technically I just use the angular stuff to run and test.

It was working fine but now everytime I run ng build --watch I get this error:

C:/Users/User/Documents/WebstormProjects/MyProject/angular-src/node_modules/@angular/cli/ember-cli/lib/ui/index.js:56     this.outputStream.write(data);                       ^  TypeError: Cannot read property 'write' of undefined     at UI.write (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/@angular/cli/ember-cli/lib/ui/index.js:56:23)     at UI.writeLine (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/@angular/cli/ember-cli/lib/ui/index.js:69:8)     at Watching.callback [as handler] (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/@angular/cli/tasks/build.js:44:29)     at Watching._done (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/webpack/lib/Compiler.js:106:8)     at compiler.emitRecords.err (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/webpack/lib/Compiler.js:79:19)     at Compiler.emitRecords (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/webpack/lib/Compiler.js:371:38)     at compiler.emitAssets.err (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/webpack/lib/Compiler.js:62:20)     at applyPluginsAsyncSeries1.err (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/webpack/lib/Compiler.js:364:12)     at next (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/tapable/lib/Tapable.js:218:11)     at Compiler.compiler.plugin (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/webpack/lib/performance/SizeLimitsPlugin.js:99:4)     at next (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/tapable/lib/Tapable.js:220:14)     at Compiler.compiler.plugin (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/@ngtools/webpack/src/plugin.js:326:13)     at next (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/tapable/lib/Tapable.js:220:14)     at callback (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/copy-webpack-plugin/dist/index.js:126:17)     at Compiler.afterEmit (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/copy-webpack-plugin/dist/index.js:220:13)     at Compiler.applyPluginsAsyncSeries1 (C:/Users/user/Documents/WebstormProjects/MyProject/angular-src/node_modules/tapable/lib/Tapable.js:222:13) 

I'm totally lost around this, I've tried multiple threads to reinstall node and angular and nothing. I've followed this one in particular: How to uninstall Angular CLI? .

The weirdest part is now when I try to do this on ubuntu by cloning the project, setting the env variables and do npm install, every time I do ng watch build it gives me the same error. But apparently, I'm the only one on the team.

 


Seems to be caused by latest version of Angular CLI (released today). I worked around it by installing previous version (6.0.8) globally.

Comment

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: