Solution to Angular - Error: tree.branch is not a function


After getting to grips to angular, and getting so used to it's CLI; which helps accelerates some processes. it can be very weird when something working so consistently before suddenly. I experienced this error today when trying to generate a new component in my project.



The error pops up after trying to generate a new component using "ng g c component-name":

Error: tree.branch is not a function
tree.branch is not a function


Solution:
Being a bit new to angular, it was weird figuring where the problem could be from. In the end what fixed it for me was, to delete node_modules folder in the root of my node-js app, (I also add another in the angular folder and also deleted that). Then ran npm install from the root of the node app.

1 comment: