首页 > 解决方案 > Azure 部署失败连接错误 NPM 注册表 ESOCKETTIMEDOUT

问题描述

出于某种原因,我的 Azure App Service React App 将不再部署。我一直在使用过去运行良好的 vscode azure 扩展。我尝试多次部署,但收到一条错误消息,说明网络连接出现问题:

4:22:06 PM app: info There appears to be trouble with your network connection. Retrying...
4:23:01 PM app: info If you think this is a bug, please open a bug report with the information provided in "/tmp/8d97465f06235f3/yarn-error.log".
4:23:01 PM app: error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.11.2.tgz: ESOCKETTIMEDOUT".

(下面的完整输出)

如果有人以前经历过这种情况或知道要尝试什么,请告诉我。

谢谢你。

4:18:38 PM app: Starting deployment...
4:18:41 PM app: Creating zip package...
4:18:41 PM app: Ignoring files from "appService.zipIgnorePattern"
"node*modules{,/**}"
".vscode{,/**}"
4:18:54 PM app: Zip package size: 1.57 MB
4:18:57 PM app: Fetching changes.
4:18:58 PM app: Cleaning up temp folders from previous zip deployments and extracting pushed zip file /tmp/zipdeploy/7620422c-53f7-4186-9716-4ac227b11a7e.zip (1.51 MB) to /tmp/zipdeploy/extracted
4:19:01 PM app: Updating submodules.
4:19:02 PM app: Preparing deployment for commit id '46cce9767f'.
4:19:02 PM app: Repository path is /tmp/zipdeploy/extracted
4:19:02 PM app: Running oryx build...
4:19:02 PM app: Command: oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 14 -i /tmp/8d97465f06235f3 -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log
4:19:05 PM app: Operation performed by Microsoft Oryx, https://github.com/Microsoft/Oryx
4:19:05 PM app: You can report issues at https://github.com/Microsoft/Oryx/issues
4:19:05 PM app: Oryx Version: 0.2.20210605.4, Commit: d2189daf082e06fece90175ba65603f21421cc64, ReleaseTagName: 20210605.4
4:19:05 PM app: Build Operation ID: |sSF6GFDir4I=.c3d38721*
4:19:05 PM app: Repository Commit : 46cce9767f1c44019ce7732a8dff6657
4:19:05 PM app: Detecting platforms...
4:19:08 PM app: Detected following platforms:
4:19:08 PM app: nodejs: 14.17.6
4:19:10 PM app: Using intermediate directory '/tmp/8d97465f06235f3'.
4:19:10 PM app: Copying files to the intermediate directory...
4:19:10 PM app: Done in 0 sec(s).
4:19:10 PM app: Source directory : /tmp/8d97465f06235f3
4:19:10 PM app: Destination directory: /home/site/wwwroot
4:19:11 PM app: Using Node version:
4:19:11 PM app: v14.17.6
4:19:12 PM app: Using Yarn version:
4:19:13 PM app: 1.22.10
4:19:13 PM app: Running 'yarn install --prefer-offline'...
4:19:13 PM app: yarn install v1.22.10
4:19:14 PM app: [1/4] Resolving packages...
4:19:18 PM app: [2/4] Fetching packages...
4:20:03 PM app: info There appears to be trouble with your network connection. Retrying...
4:20:46 PM app: info There appears to be trouble with your network connection. Retrying...
4:21:26 PM app: info There appears to be trouble with your network connection. Retrying...
4:22:06 PM app: info There appears to be trouble with your network connection. Retrying...
4:23:01 PM app: info If you think this is a bug, please open a bug report with the information provided in "/tmp/8d97465f06235f3/yarn-error.log".
4:23:01 PM app: error An unexpected error occurred: "https://registry.yarnpkg.com/@material-ui/icons/-/icons-4.11.2.tgz: ESOCKETTIMEDOUT".
4:23:01 PM app: info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
4:23:03 PM app: /opt/Kudu/Scripts/starter.sh oryx build /tmp/zipdeploy/extracted -o /home/site/wwwroot --platform nodejs --platform-version 14 -i /tmp/8d97465f06235f3 -p compress_node_modules=tar-gz --log-file /tmp/build-debug.log
4:23:05 PM app: Deployment failed.

标签: reactjsazureazure-web-app-service

解决方案


谢谢mooga,发布您的建议作为帮助其他社区成员的答案。

" 这是网络问题,我认为您使用默认超时解决方案将在 .yarnrc 文件中添加该行

yarn add YourPackageHere --network-timeout 600000

如果 600000 不起作用,请尝试增加,如果 .yarnrc 没有,则创建它”

您也可以在此处查看正在进行的讨论 React 部署不断失败并出现 ESOCKETTIMEDOUT |MS Q&A


推荐阅读