无法使用Typescript创建React应用程序

发布于 2025-02-13 01:05:16 字数 915 浏览 1 评论 0 原文

我正在尝试使用命令创建新的React新应用程序

npx反应启动init myapp-version 0.68.2-板板反应 - template-typecript

,我遇到了一个错误

错误发生意外错误:“ https://registry.npm.taobao.org/reaect-native-template-template-react-native-native-template-typescript:[not_found] react-native-template-template-template-temct-react-native-native-native-template未找到 - 未找到”。

节点版本: v16.10.0

npm版本: 7.24.0

我已经尝试

  • 以不同的方式运行的是:

npx-存在ignore的反应本地init myapp-template 反应本网板型

  • NPM卸载-g反应 - 含量
  • npm i -g @react-native-native-native-native-community/cli
  • yarn删除了全局反应式cli,

没有任何帮助解决此问题。

I'm trying to create new react new app with typescript with the command

npx react-native init myApp --version 0.68.2 --template react-native-template-typescript

and I'm getting an error

error An unexpected error occurred: "https://registry.npm.taobao.org/react-native-template-react-native-template-typescript: [NOT_FOUND] react-native-template-react-native-template-typescript not found".

enter image description here

node version: v16.10.0

npm version:7.24.0

what I already tried to do

  • run with different way:

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

  • npm uninstall -g react-native-cli
  • npm i -g @react-native-community/cli
  • yarn remove global react-native-cli

nothing helped to solve this issue.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

骷髅 2025-02-20 01:05:16

从屏幕截图中,由于某种原因,似乎正在错误地拾取模板名称,

因此应该寻找 https://registry.npmmirror.com/react-native-template-typescript 而不是 https://registry.npmmirror.com/reaeact-native-template-react-native-template-typescript

您可以尝试

npx- ignore存在的反应本iten myapp -template thexcript

,因为TAOBAO NPM已移至NPMMIRROR。 参考

From the screenshot it seems like the template name is being picked up incorrectly for some reason

it should be looking for https://registry.npmmirror.com/react-native-template-typescript instead of https://registry.npmmirror.com/react-native-template-react-native-template-typescript

Can you try

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

Since the taobao npm has been moved to npmmirror. Reference

攒眉千度 2025-02-20 01:05:16

使用:(

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

w/oa版本标签)

Use:

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

(w/o a version tag)

凉城已无爱 2025-02-20 01:05:16

您可以尝试以下行,

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

应该对您有用吗

can you try this line

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

it should work to you

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文