如何从 Stackblitz 下载和使用 Angular 项目?

问题描述

所以我在 stackblitz 上有一个项目,我想离线使用它以用于我自己的目的。作为参考,这里是我想要使用的链接 - https://stackblitz.com/edit/nvs-angular-search-dropdown-istnzp。因此,我尝试下载代码并计划使用 npm installng serve 运行它。但是我在运行 npm install 时遇到了很多错误,如下所示:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: angular@0.0.0
npm ERR! Found: @angular/compiler@12.0.3
npm ERR! node_modules/@angular/compiler
npm ERR!   @angular/compiler@"^12.0.3" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"7.0.4" from @angular/compiler-cli@7.0.4
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"~7.0.0" from the root project     
npm ERR! 
npm ERR! Fix the upstream dependency conflict,or retry
npm ERR! this command with --force,or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See C:\Users\cnaag\AppData\Local\npm-cache\eresolve-report.txt for a full report.    

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\cnaag\AppData\Local\npm-cache\_logs\2021-06-06T10_39_43_617Z-debug.log 

这方面的任何帮助都会很棒!

解决方法

代替 NPM,在你的机器上安装 Yarn 并运行 yarn install

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...