How to compile and run a 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 troubleshooting

rm -rf .next
NEXT_PUBLIC_BUILD_DEBUG=1 next build


to run as a service

npm install pm2
pm2 start "next start" --name callhome-frontend

No comments:

Post a Comment

How to compile and run a 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 inst...