gpt4 book ai didi

reactjs - linux azure web 应用程序不显示我的reactjs 应用程序

转载 作者:行者123 更新时间:2023-12-02 23:16:01 26 4
gpt4 key购买 nike

我使用 npx create-react-app 创建了一个 Reactjs Web 应用程序,并创建了一个 azure ci/cd 管道以将构建文件夹推送到我的 Linux Web 应用程序实例。我还指定了启动命令:

pm2 serve /home/site/wwwroot --no-daemon --spa

我验证了构建文件夹内容位于 wwwroot 文件夹中,但我的 Linux Web 应用程序没有显示任何内容。

我的网络应用程序网址:https://linux--dev.azurewebsites.net/我的网络应用程序内容:

$ ls /home/site/wwwroot -al
total 37
drwxrwxrwx 2 nobody nogroup 4096 Mar 16 10:21 .
drwxrwxrwx 2 nobody nogroup 0 Mar 16 10:21 ..
-rwxrwxrwx 1 nobody nogroup 1092 Mar 16 10:21 asset-manifest.json
-rwxrwxrwx 1 nobody nogroup 3870 Mar 16 10:21 favicon.ico
-rwxrwxrwx 1 nobody nogroup 3010 Mar 16 10:21 index.html
-rwxrwxrwx 1 nobody nogroup 5347 Mar 16 10:21 logo192.png
-rwxrwxrwx 1 nobody nogroup 9664 Mar 16 10:21 logo512.png
-rwxrwxrwx 1 nobody nogroup 492 Mar 16 10:21 manifest.json
-rwxrwxrwx 1 nobody nogroup 67 Mar 16 10:21 robots.txt
drwxrwxrwx 2 nobody nogroup 0 Mar 16 10:21 static

2021-03-16T11:23:14.156072674Z   _____                               
2021-03-16T11:23:14.156107475Z / _ \ __________ _________ ____
2021-03-16T11:23:14.156112975Z / /_\ \___ / | \_ __ \_/ __ \
2021-03-16T11:23:14.156116975Z / | \/ /| | /| | \/\ ___/
2021-03-16T11:23:14.156120475Z \____|__ /_____ \____/ |__| \___ >
2021-03-16T11:23:14.156124075Z \/ \/ \/
2021-03-16T11:23:14.156127375Z A P P S E R V I C E O N L I N U X
2021-03-16T11:23:14.156130575Z
2021-03-16T11:23:14.156133676Z Documentation: http://aka.ms/webapp-linux
2021-03-16T11:23:14.156136776Z NodeJS quickstart: https://aka.ms/node-qs
2021-03-16T11:23:14.156139976Z NodeJS Version : v14.15.1
2021-03-16T11:23:14.156143076Z Note: Any data outside '/home' is not persisted
2021-03-16T11:23:14.156146376Z
2021-03-16T11:23:14.318873080Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2021-03-16T11:23:14.318893181Z Could not find operation ID in manifest. Generating an operation id...
2021-03-16T11:23:14.318897181Z Build Operation ID: 9baf36d5-1dca-413f-929a-d66115f66772
2021-03-16T11:23:14.845130025Z Environment Variables for Application Insight's IPA Codeless Configuration exists..
2021-03-16T11:23:15.173100881Z Writing output script to '/opt/startup/startup.sh'
2021-03-16T11:23:15.352933180Z Running #!/bin/sh
2021-03-16T11:23:15.369142014Z
2021-03-16T11:23:15.369169414Z # Enter the source directory to make sure the script runs where the user expects
2021-03-16T11:23:15.369175515Z cd "/home/site/wwwroot"
2021-03-16T11:23:15.369179015Z
2021-03-16T11:23:15.369182315Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2021-03-16T11:23:15.369185715Z if [ -z "$PORT" ]; then
2021-03-16T11:23:15.369189115Z export PORT=8080
2021-03-16T11:23:15.369192715Z fi
2021-03-16T11:23:15.369195915Z
2021-03-16T11:23:15.369200215Z PATH="$PATH:/home/site/wwwroot" pm2 serve /home/site/wwwroot --no-daemon --spa
2021-03-16T11:23:15.381752696Z /opt/startup/startup.sh: 11: /opt/startup/startup.sh: pm2: not found

我错过了什么吗?

最佳答案

尝试在启动命令中使用npxserve -s

enter image description here

这对我有用。

enter image description here

enter image description here

关于reactjs - linux azure web 应用程序不显示我的reactjs 应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66647642/

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