gpt4 book ai didi

typescript - 错误 发生意外错误 : "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found"

转载 作者:行者123 更新时间:2023-12-03 23:42:53 25 4
gpt4 key购买 nike

卸载后react-native-cli我运行此命令以使用 typescript 模板启动 RN 项目:

npx react-native init MyApp --template react-native-template-typescript

但我收到了这个错误:

warning jest > jest-cli > jest-config > jest-environment-jsdom > jsdom

left-pad@1.3.0: use String.prototype.padStart() error An unexpected error occurred: "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found".info If you think this is a bug, please open .....
[1/2] Removing module react-native-template-react-native-template-typescript...
error This module isn't specified in a package.json file.
info Visit https://yarnpkg.com/en/docs/cli/remove for documentation about this command. warn Failed to clean up template temp files in node_modules/react-native-template-react-native-template-typescript. This is not a critical error, you can work on your app.
(node:8548) UnhandledPromiseRejectionWarning: Error: Command failed: yarn add react-native-template-react-native-template-typescript

最佳答案

删除旧的 react-native-cli
npm uninstall -g react-native-cli
从“react-native-community”安装新的:
npm i -g @react-native-community/cli
之后,使用以下命令初始化项目:
npx react-native init MyApp --template react-native-template-typescript

关于typescript - 错误 发生意外错误 : "https://registry.yarnpkg.com/react-native-template-react-native-template-typescript: Not found",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58078702/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com