Angular 4 - “tree.branch is not a function” when trying to start a new project

不羁的心 提交于 2019-12-04 14:35:37

问题


When I run ng new testApp I get this error

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

My node version is 6.11.4
My angular/cli version is 1.4.5
My os is win32 x64

I'm trying to get angular to work on my work PC.

No idea what i'm doing wrong. Help


回答1:


Remove the node_modules folder from your $HOME directory

cd $HOME
rm -rf node_modules

For some reason the node_modules folder was in the $HOME directory and ng CLI was using it.




回答2:


I had the same issue with npm 5.5.1 node 8.8.1 and angular cli 1.4.9 (latest from everything)

It failed always, when I was running it anywhere else than the $HOME directory.

But it worked in the $HOME

So I just create projects in $HOME and then I move to the final location.



来源:https://stackoverflow.com/questions/46695065/angular-4-tree-branch-is-not-a-function-when-trying-to-start-a-new-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!