npx 在 React、Expo 和下一个应用程序初始化期间挂起

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

我目前遇到一个问题,在尝试初始化项目时,以下命令(以及可能更多)无限期挂起:

  • npx create-react-app
  • npx create-expo-app
  • npx create-next-app

这是一个例子:

C:\Users\james\Documents>npx create-expo-app@latest my-app

然后它会播放旋转进度轮动画 (|/-|) ~2 次,并且无限期地卡住没有任何进度。我把它放在一边好几个小时了,什么也没发生。

Ctrl + C
用于终止批处理作业。

以下是我尝试解决该问题的一些方法:

  1. 重新启动我的电脑(多次)
  2. 多次卸载并重新安装 Node.js(包括使用 fnm Fast Node Manager 一次)
  3. 安装不同版本的 Node.js(包括 v18.20.4 LTS、v20.15.1 LTS 和 v22.5.0)
  4. 尝试了 Windows CMD(以及以管理员身份运行)、Windows Powershell 和 VS Code 中的命令
  5. 尝试使用
    npm config set registry http://registry.npmjs.org/ --global
    设置注册表(仍然是同样的问题)
  6. 尝试清除缓存
    npm cache clear --force
    (仍然是同样的问题)
  7. 全局安装
    create-expo-app
    然后使用它(还是同样的问题)
  8. 我什至尝试用 Yarn 安装它......不幸的是,它附带了一整页的重复警告,如下所示:
warning expo > @expo/cli > [email protected]: Glob versions prior to v9 are no longer supported

warning expo > babel-preset-expo > @react-native/babel-preset > @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-numeric-separator instead.

warning expo > @expo/cli > @expo/rudder-sdk-node > @expo/bunyan > mv > [email protected]: Rimraf versions prior to v4 are no longer supported

warning expo > @expo/cli > @expo/rudder-sdk-node > @expo/bunyan > mv > rimraf > glob > [email protected]: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.

warning "expo > babel-preset-expo > @react-native/babel-preset > @react-native/babel-plugin-codegen > @react-native/codegen > [email protected]" has unmet peer dependency "@babel/preset-env@^7.1.6".

然后,yarn 命令卡在空的进度条上:

[---------------------------------------------------------------------------------------------------------------] 0/719

请帮忙🙏

当前系统信息:

Windows 11

> node -v
v22.5.0

>npm -v
10.8.2

npx create-expo-app@latest my-app 挂起并卡住,没有任何进展

node.js npm create-react-app yarnpkg npx
1个回答
0
投票

我刚刚安装了节点 v22.5.1,它开始工作,没有挂起,所以我想这就是修复方法

最新问题
© www.soinside.com 2019 - 2025. All rights reserved.