简体   繁体   English

创建离子应用程序时无法解析依赖树

[英]unable to resolve dependency tree when create ionic app

Hi when I want to create an ionic app, I get this error that I couldn't fix it:嗨,当我想创建一个 ionic 应用程序时,我收到了无法修复的错误:

npm ERR! npm 错误! code ERESOLVE npm ERR!代码 ERESOLVE npm 错误! ERESOLVE unable to resolve dependency tree npm ERR! ERESOLVE 无法解析依赖树 npm ERR!

npm ERR! Found: postcss@8.2.14
npm ERR! node_modules/postcss
npm ERR!   postcss@"8.2.14" from @angular-devkit/build-angular@0.1102.13
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!     peer @angular-devkit/build-angular@"^0.1102.4" from @ionic/angular-toolkit@3.1.1
npm ERR!     node_modules/@ionic/angular-toolkit
npm ERR!       dev @ionic/angular-toolkit@"^3.1.1" from the root project
npm ERR!   peer postcss@"^8.1.0" from autoprefixer@10.2.4
npm ERR!   node_modules/autoprefixer
npm ERR!     autoprefixer@"10.2.4" from @angular-devkit/build-angular@0.1102.13
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!       1 more (@ionic/angular-toolkit)
npm ERR!   9 more (css-loader, cssnano, postcss-import, postcss-loader, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer postcss@"^8.2.15" from cssnano-preset-default@5.1.1
npm ERR! node_modules/cssnano/node_modules/cssnano-preset-default
npm ERR!   cssnano-preset-default@"^5.0.1" from cssnano@5.0.2
npm ERR!   node_modules/cssnano
npm ERR!     cssnano@"5.0.2" from @angular-devkit/build-angular@0.1102.13
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!       1 more (@ionic/angular-toolkit)
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.
[ERROR] An error occurred while running subprocess npm.

        npm.cmd i exited with exit code 1.

I check so many ways but couldn't solve that.我检查了很多方法,但无法解决。 please help me请帮我

Use this command:使用这个命令:

npm install --save --legacy-peer-deps

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM