Versions of @angular/compiler-cli and typescript could not be determined

前端 未结 11 2533
耶瑟儿~
耶瑟儿~ 2020-12-28 14:35

I have installed Angular/cli and then try to run command ng serve then below error is throwing. I have tried lot of thing like uninstall angular/cli, npm cache clean, etc

11条回答
  •  执念已碎
    2020-12-28 14:54

    Actually the real problem is with npm.

    If its downloading as --legacy-bundling=true (Which is by default) then you will have this issue. If you see node_modules folder all the dependent modules would be nested.

    When you run npm install command you should set --legacy-bundling=false

    npm install --legacy-bundling=false
    

    Now if you see node_modules folder no any module would be nested. And everything will work.

    You can set npm default behaviour using following command, then you will not have to set every time.

    npm set --legacy-bundling=false
    

提交回复
热议问题