linux azure web app不显示我的reactjs app

0yg35tkg  于 2023-06-30  发布在  Linux
关注(0)|答案(1)|浏览(98)

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

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

我验证了构建文件夹内容在wwwroot文件夹中,但我的Linux Web应用程序没有显示任何内容。
我的web应用程序url:https://linux--dev.azurewebsites.net/我的Web应用程序内容:

$ 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

我错过什么了吗

fkvaft9z

fkvaft9z1#

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

对我很有效。

相关问题