当我使用命令“yarn create react-app .”启动项目时如何解决警告?

问题描述 投票:0回答:1

我在使用

yarn create react-app . --template typescript
创建新应用程序时收到很多警告。怎么解决?

warning react-scripts > babel-preset-react-app > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-optional-chaining instead.
warning react-scripts > babel-preset-react-app > @babel/[email protected]: This proposal has been merged to the ECMAScript standard and thus this plugin is no longer maintained. Please use @babel/plugin-transform-private-methods instead.
warning react-scripts > workbox-webpack-plugin > [email protected]: this package has been deprecated
warning react-scripts > @svgr/webpack > @svgr/plugin-svgo > [email protected]: This SVGO version is no longer supported. Upgrade to v2.x.x.
warning react-scripts > react-dev-utils > fork-ts-checker-webpack-plugin > [email protected]: this will be v4   
warning react-scripts > webpack-dev-server > webpack-dev-middleware > [email protected]: this will be v4        
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: This package has been deprecated and is no longer maintained. Please use @rollup/plugin-terser
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: [email protected]
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-background-sync > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-cacheable-response > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-google-analytics > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-google-analytics > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-navigation-preload > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-precaching > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-range-requests > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-google-analytics > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-precaching > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-routing > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-google-analytics > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-precaching > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-strategies > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-streams > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-streams > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-broadcast-update > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-expiration > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-recipes > [email protected]: [email protected]
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-recipes > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-recipes > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-recipes > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-recipes > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-recipes > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > [email protected]: this package has been deprecated
warning react-scripts > workbox-webpack-plugin > workbox-build > workbox-window > [email protected]: this package has been deprecated
warning react-scripts > @svgr/webpack > @svgr/plugin-svgo > svgo > [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
warning react-scripts > css-minimizer-webpack-plugin > cssnano > cssnano-preset-default > postcss-svgo > svgo > [email protected]: Modern JS already guarantees Array#sort() is a stable sort, so this library is deprecated. See the compatibility table on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/sort#browser_compatibility
warning react-scripts > workbox-webpack-plugin > workbox-build > @rollup/plugin-replace > magic-string > [email protected]: Please use @jridgewell/sourcemap-codec instead
warning react-scripts > jest > jest-cli > jest-config > jest-environment-jsdom > jsdom > [email protected]: Use your platform's native performance.now() and performance.timeOrigin.
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5".
warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".
warning "react-scripts > react-dev-utils > [email protected]" has unmet peer dependency "typescript@>= 2.7".
warning "react-scripts > eslint-config-react-app > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
yarn remove v1.22.18
[1/2] Removing module cra-template-typescript...
[2/2] Regenerating lockfile and installing missing dependencies...
warning " > @testing-library/[email protected]" has unmet peer dependency "@testing-library/dom@>=7.21.4".
warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5".
warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".
success Uninstalled packages.
Done in 6.97s.

通过 npx 就可以了。但使用纱线有问题。

reactjs typescript babeljs yarnpkg
1个回答
0
投票

我想更好地了解所有这些警告的真正含义,以及是否确实需要对它们采取任何措施。使用纱线安装软件包时,我看到相同的输出。特别是关于未满足的对等依赖关系的警告。难道yarn不应该安装这些依赖项吗?

warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-syntax-flow@^7.14.5". warning "react-scripts > eslint-config-react-app > [email protected]" has unmet peer dependency "@babel/plugin-transform-react-jsx@^7.14.9".

© www.soinside.com 2019 - 2024. All rights reserved.