azure app nodejs simple deployment

Ayan 1 Reputation point
2021-10-27T07:25:52.097+00:00

I have followed the basic steps to create an app service and chose the free tier.

Next I used az shell to create a simple nodejs app locally [no git]

I then used az webapp up -n app -g rg

deployment done

app does not work. Says module "express" not found.

locally the npm install is done - node modules exist; npm start works.

see log extract

2021-10-27T04:48:54.382431884Z _____
2021-10-27T04:48:54.382478485Z / _ \ __________ _________ ____
2021-10-27T04:48:54.382489885Z / /_\ ___ / | _ __ _/ __ \
2021-10-27T04:48:54.382496185Z / | / /| | /| | /\ /
2021-10-27T04:48:54.382502785Z _
|__ /_____ ____/ || _ >
2021-10-27T04:48:54.382509285Z / / /
2021-10-27T04:48:54.382558485Z A P P S E R V I C E O N L I N U X
2021-10-27T04:48:54.382565485Z
2021-10-27T04:48:54.382570886Z Documentation: http://aka.ms/webapp-linux
2021-10-27T04:48:54.382576986Z NodeJS quickstart: https://aka.ms/node-qs
2021-10-27T04:48:54.382582886Z NodeJS Version : v10.14.2
2021-10-27T04:48:54.382588686Z Note: Any data outside '/home' is not persisted
2021-10-27T04:48:54.382594586Z
2021-10-27T04:48:54.596817410Z Cound not find build manifest file at '/home/site/wwwroot/oryx-manifest.toml'
2021-10-27T04:48:54.596860310Z Could not find operation ID in manifest. Generating an operation id...
2021-10-27T04:48:54.597011411Z Build Operation ID: 44ef5cdf-bfb8-47f6-9d17-ecc992542a87
2021-10-27T04:48:56.231508274Z Environment Variables for Application Insight's IPA Codeless Configuration exists..
2021-10-27T04:48:56.500931240Z Writing output script to '/opt/startup/startup.sh'
2021-10-27T04:48:57.238400334Z Running #!/bin/sh
2021-10-27T04:48:57.238492435Z
2021-10-27T04:48:57.238593336Z # Enter the source directory to make sure the script runs where the user expects
2021-10-27T04:48:57.238609036Z cd "/home/site/wwwroot"
2021-10-27T04:48:57.238746937Z
2021-10-27T04:48:57.238759837Z export NODE_PATH=/usr/local/lib/node_modules:$NODE_PATH
2021-10-27T04:48:57.239149140Z if [ -z "$PORT" ]; then
2021-10-27T04:48:57.239327541Z export PORT=8080
2021-10-27T04:48:57.239489642Z fi
2021-10-27T04:48:57.239623443Z
2021-10-27T04:48:57.239762544Z npm start
2021-10-27T04:48:58.027894232Z npm info it worked if it ends with ok
2021-10-27T04:48:58.027937633Z npm info using npm@6.14.10
2021-10-27T04:48:58.028046033Z npm info using node@Vignesh .14.2
2021-10-27T04:48:58.362777108Z npm info lifecycle nodeapp@1.0.0~prestart: nodeapp@1.0.0
2021-10-27T04:48:58.369166153Z npm info lifecycle nodeapp@1.0.0~start: nodeapp@1.0.0
2021-10-27T04:48:58.371849072Z
2021-10-27T04:48:58.371874572Z > nodeapp@1.0.0 start /home/site/wwwroot
2021-10-27T04:48:58.371882972Z > node app
2021-10-27T04:48:58.371888472Z
2021-10-27T04:48:58.529620391Z internal/modules/cjs/loader.js:583
2021-10-27T04:48:58.529661792Z throw err;
2021-10-27T04:48:58.529679892Z ^
2021-10-27T04:48:58.529686392Z
2021-10-27T04:48:58.529692092Z Error: Cannot find module 'express'
2021-10-27T04:48:58.529697592Z at Function.Module._resolveFilename (internal/modules/cjs/loader.js:581:15)
2021-10-27T04:48:58.529703092Z at Function.Module._load (internal/modules/cjs/loader.js:507:25)
2021-10-27T04:48:58.529708492Z at Module.require (internal/modules/cjs/loader.js:637:17)
2021-10-27T04:48:58.529714492Z at require (internal/modules/cjs/helpers.js:22:18)
2021-10-27T04:48:58.529720292Z at Object.<anonymous> (/home/site/wwwroot/app.js:1:77)
2021-10-27T04:48:58.529726592Z at Module._compile (internal/modules/cjs/loader.js:689:30)
2021-10-27T04:48:58.529732592Z at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
2021-10-27T04:48:58.529738892Z at Module.load (internal/modules/cjs/loader.js:599:32)
2021-10-27T04:48:58.529744792Z at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
2021-10-27T04:48:58.529752092Z at Function.Module._load (internal/modules/cjs/loader.js:530:3)
2021-10-27T04:48:58.537555848Z npm info lifecycle nodeapp@1.0.0~start: Failed to exec start script
2021-10-27T04:48:58.542616783Z npm ERR! code ELIFECYCLE
2021-10-27T04:48:58.542640584Z npm ERR! errno 1
2021-10-27T04:48:58.544107094Z npm ERR! nodeapp@1.0.0 start: node app
2021-10-27T04:48:58.545147501Z npm ERR! Exit status 1
2021-10-27T04:48:58.546311710Z npm ERR!
2021-10-27T04:48:58.548340324Z npm ERR! Failed at the nodeapp@1.0.0 start script.
2021-10-27T04:48:58.549321631Z npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
2021-10-27T04:48:58.584475780Z npm WARN Local package.json exists, but node_modules missing, did you mean to install?
2021-10-27T04:48:58.586637196Z npm timing npm Completed in 604ms
2021-10-27T04:48:58.586662396Z
2021-10-27T04:48:58.586669196Z npm ERR! A complete log of this run can be found in:
2021-10-27T04:48:58.586674996Z npm ERR! /root/.npm/_logs/2021-10-27T04_48_58_550Z-debug.log

Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
6,956 questions
{count} votes