我正在嘗試使用這樣的 npx 使用打字稿模板創建一個新專案
npx react-native init AwesomeTSProject --template react-native-template-typescript
它創建了檔案夾,但它向我顯示了這個錯誤
? Downloading template
? Copying template
? Processing template
? Installing dependencies
error Error: Command failed: yarn install
warning react-native > @react-native-community/cli-platform-ios > xcode > [email protected]: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.
warning react-native > @react-native-community/cli > @react-native-community/cli-plugin-metro > metro > jest-haste-map > [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
warning react-native > @react-native-community/cli > @react-native-community/cli-plugin-metro > metro > metro-minify-uglify > [email protected]: support for ECMAScript is superseded by `uglify-js` as of v3.13.0
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: https://github.com/lydell/resolve-url#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: Please see https://github.com/lydell/urix#deprecated
warning react-native > react-native-codegen > jscodeshift > micromatch > snapdragon > source-map-resolve > [email protected]: See https://github.com/lydell/source-map-url#deprecated
warning @react-native-community/eslint-config > [email protected]: babel-eslint is now @babel/eslint-parser. This package will no longer receive updates.
error @typescript-eslint/[email protected]: The engine "node" is incompatible with this module. Expected version "^12.22.0 || ^14.17.0 || >=16.0.0". Got "15.14.0"
error Found incompatible module.
yarn install v1.22.17
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
我已經檢查了https://yarnpkg.com/en/docs/cli/install和https://v8.dev/blog/math-random但找不到問題,我已經在 Stack 中檢查過溢位但沒有找到任何東西。
uj5u.com熱心網友回復:
就我而言,升級節點版本解決了這個問題。
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/433662.html
下一篇:如何等待淡出功能結束?
