janekkkk
janekkkk

Reputation: 366

Nuxt.js app error when starting on Azure web apps

I'm trying to run a Nuxt.js application on Azure. When I deploy the application (successfully) using Azure Devops CI/CD to Azure web apps, the application won't run.

See the error below.

As far as I understand this means that the package.json can't be found and because of that the application can't start.

Images of my build/release pipeline on 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

However when I check the index of wwwroot I can see that my application is not there. Only an "S" directory which DOES contains the application. How do those files get in this "S" directory?

How do I get them out or change the working directory so the script won't fail?

Imgur

Upvotes: 0

Views: 1862

Answers (1)

Levi Lu-MSFT
Levi Lu-MSFT

Reputation: 30343

I guess you might accidently checking option Prepend root folder name to archive paths in the archive files task in your build pipeline. Checking this option will end up getting your files in "S" folder.

enter image description here

Please check task Achive Files of your build pipeline, Make sure Prepend root folder name to archive paths is unchecked.

Upvotes: 1

Related Questions