Skip to content

Instantly share code, notes, and snippets.

@hamidrhashmi
Created November 29, 2024 12:02
Show Gist options
  • Save hamidrhashmi/024b4820d3c72095435f20bd3bf693fd to your computer and use it in GitHub Desktop.
Save hamidrhashmi/024b4820d3c72095435f20bd3bf693fd to your computer and use it in GitHub Desktop.
How to compile and deploy next application

Install nodejs

Use this link for further reading

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash
nvm install 22
node -v 
npm -v 

Install next

npm install -g next@latest react@latest react-dom@latest

Download next application

for Development

git clone https://github.com/hamidrhashmi/next-app.git
cd next-app
npm install
next dev -H 0.0.0.0 -p 80

For Production

npm build

or

npm run build

start Application

npm start

for troublshooting

rm -rf .next
NEXT_PUBLIC_BUILD_DEBUG=1 next build

to run as service

npm install pm2
pm2 start "next start" --name callhome-frontend
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment