Error installing Angular using npm due to require-from-string

后端 未结 6 803
名媛妹妹
名媛妹妹 2020-11-29 09:00

How to resolve this error as I am not able to install Angular.

Please see the below exception:

C:\\Users\\absin\\node>npm install -g @angular/cli
         


        
6条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-11-29 10:00

    I had the same issue. So when I used yarn it worked well and not having any problem to create new projects also.

    yarn global add @angular/cli
    

    again, when you create new app ng new newapp it will fail because at this moment npm is not able to find a package called require-from-string. But the you can run yarn to install all the packages. Yarn will ask which version of the require-from-string is needed. you can choose it.

提交回复
热议问题