The pipelines and releases seem to work finely as they get the artifact deployed on the app service or so it seems as the output error happens on start of the PM2 process.
I haven't found anything on this error on google, and don't know if there is a way to update PM2 on the app service machine as PM2 itself suggests.
These are the logs.
Error message
summary image
I was expecting the app to work and no longer show an application error as I fixed both build and release pipelines.
This is a picture of the important bit of info of the error as its really long
Check the below steps to run nextjs with PM2
.
nextJS app
. Run npm run dev
command to run the app in development.
Open the SSH
of the Azure App Service to run the PM2 commands.
https://YourDeployedAppName.scm.azurewebsites.net/
OR
Azure Linux App
=> Advanced Tools
=> Go
=> SSH
. Run the below command to install PM2
.
npm install pm2 -g
Thanks @ Azure OSS Developer Support for the commands.
Configuration
section => General Settings
add the Startup command. pm2 start site/root/index.js --name mynpmnextapp
Your path may differ for the index.js file.
My app entry point is index.js
.For some apps it can be server.js
.Change it according to your app.
cannot find module `../build/output/log'
Make sure you are not running the PM2
with the output folder. As mentioned above it has to be the entry point either server.js
or index.js
based on your code files.
don't know if there is a way to update PM2 on the app service
In the KUDU Console
use npm install pm2@latest -g
to update the PM2.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.