在Azure Web应用程序上启动时出现Nuxt.js应用程序错误 [英] Nuxt.js app error when starting on Azure web apps
本文介绍了在Azure Web应用程序上启动时出现Nuxt.js应用程序错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
请参阅下面的错误。
据我所知,这意味着找不到Package.json,因此应用程序无法启动。
我在Azure DevOps上的构建/发布管道的图像here。
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
但是,当我检查wwwroot的索引时,我可以看到我的应用程序不在那里。只有一个包含该应用程序的"S"目录。这些文件是如何放入此"S"目录的?
如何将它们取出或更改工作目录以使脚本不会失败?
推荐答案
我猜您可能不小心选中了构建管道中存档文件任务中的Prepend root folder name to archive paths
选项。选中此选项将最终将您的文件放到"S"文件夹中。
请检查生成管道的任务Achive Files
,确保未选中Prepend root folder name to archive paths
。
这篇关于在Azure Web应用程序上启动时出现Nuxt.js应用程序错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文