Node.js 在Azure web应用程序上启动时出现Nuxt.js应用程序错误
我正在尝试在Azure上运行Nuxt.js应用程序。当我使用Azure Devops CI/CD将应用程序(成功)部署到Azure web apps时,应用程序将不会运行 请参见下面的错误 据我所知,这意味着无法找到package.json,因此应用程序无法启动 Azure Devops上我的构建/发布管道的图像 然而,当我检查wwwroot的索引时,我可以看到我的应用程序不在那里。只有包含应用程序的“S”目录。这些文件如何进入这个“S”目录 如何将它们取出或更改工作目录以使脚本不会失败Node.js 在Azure web应用程序上启动时出现Nuxt.js应用程序错误,node.js,azure,azure-devops,azure-web-app-service,nuxt.js,Node.js,Azure,Azure Devops,Azure Web App Service,Nuxt.js,我正在尝试在Azure上运行Nuxt.js应用程序。当我使用Azure Devops CI/CD将应用程序(成功)部署到Azure web apps时,应用程序将不会运行 请参见下面的错误 据我所知,这意味着无法找到package.json,因此应用程序无法启动 Azure Devops上我的构建/发布管道的图像 然而,当我检查wwwroot的索引时,我可以看到我的应用程序不在那里。只有包含应用程序的“S”目录。这些文件如何进入这个“S”目录 如何将它们取出或更改工作目录以使脚本不会失败 我猜您
我猜您可能不小心选中了选项
在生成管道中的存档文件任务中,将根文件夹名称前置到存档路径中。选中此选项将最终将文件放入“S”文件夹
请检查生成管道的任务Achive文件
,确保未选中Prepend root folder name to archive path
。您可以共享Azure管道吗?可能是部署步骤中的某个步骤。您的部署中似乎有问题,能否请共享部署的其他步骤?有关我的构建/发布的更多信息,请参阅pipeline@janekkkk你试过下面的解决方案吗?进展如何?
2019-09-11T08:09:27.409935226Z _____
2019-09-11T08:09:27.409972726Z / _ \ __________ _________ ____
2019-09-11T08:09:27.409980026Z / /_\ \___ / | \_ __ \_/ __ \
2019-09-11T08:09:27.409985426Z / | \/ /| | /| | \/\ ___/
2019-09-11T08:09:27.409990326Z \____|__ /_____ \____/ |__| \___ >
2019-09-11T08:09:27.409995626Z \/ \/ \/
2019-09-11T08:09:27.410000626Z A P P S E R V I C E O N L I N U X
2019-09-11T08:09:27.410005526Z
2019-09-11T08:09:27.410009926Z Documentation: http://aka.ms/webapp-linux
2019-09-11T08:09:27.410014626Z NodeJS quickstart: https://aka.ms/node-qs
2019-09-11T08:09:27.410019226Z NodeJS Version : v10.16.0
2019-09-11T08:09:27.410023826Z
2019-09-11T08:09:27.781011935Z /opt/startup/init_container.sh: line 32: [: ==: unary operator expected
2019-09-11T08:09:28.029460609Z Oryx Version : 0.2.20190730.1, Commit: 4ef0d5854df39c57605e59bb6d255215cc85468a
2019-09-11T08:09:28.067056450Z
2019-09-11T08:09:28.093996380Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2019-09-11T08:09:28.094015980Z Could not find operation ID in manifest. Generating an operation id...
2019-09-11T08:09:28.094229780Z Build Operation ID: 3b273fa4-2c0a-44fe-82d5-d3558b0f435e
2019-09-11T08:09:28.981601858Z Writing output script to '/opt/startup/startup.sh'
2019-09-11T08:09:28.992611670Z Running #!/bin/sh
2019-09-11T08:09:28.993286971Z
2019-09-11T08:09:28.993302171Z # Enter the source directory to make sure the script runs where the user expects
2019-09-11T08:09:28.993319471Z cd "/home/site/wwwroot"
2019-09-11T08:09:28.993325871Z
2019-09-11T08:09:28.994364772Z if [ -z "$PORT" ]; then
2019-09-11T08:09:28.994378572Z export PORT=8080
2019-09-11T08:09:28.994997373Z fi
2019-09-11T08:09:28.995010873Z
2019-09-11T08:09:28.995015273Z PATH="$PATH:/home/site/wwwroot" npm run start:prod
2019-09-11T08:09:31.501668636Z npm ERR! path /home/site/wwwroot/package.json
2019-09-11T08:09:31.502666537Z npm ERR! code ENOENT
2019-09-11T08:09:31.518772254Z npm ERR! errno -2
2019-09-11T08:09:31.518809454Z npm ERR! syscall open
2019-09-11T08:09:31.520098056Z npm ERR! enoent ENOENT: no such file or directory, open '/home/site/wwwroot/package.json'
2019-09-11T08:09:31.521179157Z npm ERR! enoent This is related to npm not being able to find a file.
2019-09-11T08:09:31.522101458Z npm ERR! enoent
2019-09-11T08:09:31.640775689Z
2019-09-11T08:09:31.641914090Z npm ERR! A complete log of this run can be found in:
2019-09-11T08:09:31.646957596Z npm ERR! /root/.npm/_logs/2019-09-11T08_09_31_532Z-debug.log