Installation
Welcome to Next.js! Next.js helps you build modern applications for the web, mobile, or desktop.
For getting started a Next.js application you needs two things as Prerequisites.
Prerequisites
- Before you begin, make sure your development environment includes Node and an Node Package Manager (npm).
Node.js
- Download 20+ version of node.js from nodejs.org.
- Install Node.js using downloaded file
- To check your node version, run node -v in a terminal/console window.
Node Package Manager (npm)
- Next.js apps depend on features and functionality provided by libraries that are available as npm packages. To download and install npm packages, you must have an npm
- This Quick Start uses the npm client command line interface, which is installed with Node.js by default. To check that you have the npm client installed, run npm -v in a terminal/console window.
- For better understanding Next.js we suggest you to once go through official documentation of Next.js from Nextjs.org
Next.js Setup
- If you want Kartify theme setup then directly follow next Kartify setup section
Creating a Next.js App
- You use the create-next-app to create projects, generate application and library code, and perform a variety of ongoing development tasks as it is a progressive framework for building user interfaces.
- You can use create-next-app to initialize a Next.js app.
- To install the CLI using npm, open a terminal/console window and enter the following command:
npx create-next-app@latest
Create Initial project
- Run the CLI command create-next-app and provide the name my-app, as shown here:
npx create-next-app@latest my-app
Run project
- Go to the workspace folder (my-app).
cd my-app
- Launch the server by using the CLI command npm run dev
npm run dev
Kartify Setup
- If you have already download and install node.js and Next.js CLI then ignore prerequisites accordingly.
Node.js
- Download 20+ version of node.js from nodejs.org.
- Install Node.js using downloaded file
- To check your node version, run node -v in a terminal/console window.
Creating a Next.js App
npx create-next-app@latest
Setup Kartify theme by
- Download and extract an Kartify themes from themeforest
- Extract it and then go in to theme folder.
cd theme
- Import all dependency by installing npm command
npm install
- Now you are in stage to successfully run Kartify using below command:
npm run dev
- Once you serve your application by default it will take their defalult port so you can open port using localhost:3000
- Make sure you are not running any other next.js project in local if so then use new generated port from terminal with label called app running at:
Some Common solution if you do not run project successfully
- Use Latest Version of node.js
- Remove node_module and package-lock.json file and again do npm install
- You can again download theme from themeforst and then again run
- Then also if you don't solve issue you can generate a ticket
Build Application
- Build you application for host on server using below command:
npm run build
- Now upload your dist folder on public folder