CentOS Stream 10
Sponsored Link

Next.js : Install2025/02/10

 

Install Next.js which is a React-based web development framework.

[1]

Install Node.js, refer to here.

[2] Create a test Next.js application with a common user.
[cent@dlp ~]$
mkdir testproject

[cent@dlp ~]$
cd testproject
# create Next.js application [test-app]

[cent@dlp testproject]$
npx create-next-app test-app

✓ Would you like to use TypeScript? ... No / Yes
✓ Would you like to use ESLint? ... No / Yes
✓ Would you like to use Tailwind CSS? ... No / Yes
✓ Would you like your code inside a `src/` directory? ... No / Yes
✓ Would you like to use App Router? (recommended) ... No / Yes
✓ Would you like to use Turbopack for `next dev`? ... No / Yes
✓ Would you like to customize the import alias (`@/*` by default)? ... No / Yes
Creating a new Next.js app in /home/cent/testproject/test-app.

Using npm.

Initializing project with template: app-tw


Installing dependencies:
- react
- react-dom
- next

Installing devDependencies:
- typescript
- @types/node
- @types/react
- @types/react-dom
- postcss
- tailwindcss
- eslint
- eslint-config-next
- @eslint/eslintrc

.....
.....

added 376 packages, and audited 377 packages in 22s

143 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities
Success! Created test-app at /home/cent/testproject/test-app

[cent@dlp testproject]$
cd test-app
# run development server

[cent@dlp test-app]$
npm run dev


> test-app@0.1.0 dev
> next dev --turbopack

   ▲ Next.js 15.1.6 (Turbopack)
   - Local:        http://localhost:3000
   - Network:      http://10.0.0.30:3000

 ✓ Starting...
 ✓ Ready in 907ms


# or build and run the app in production mode

[cent@dlp test-app]$
npm run build


.....
.....

○  (Static)  prerendered as static content

[cent@dlp test-app]$ npm start 

> test-app@0.1.0 start
> next start

   ▲ Next.js 15.1.6
   - Local:        http://localhost:3000
   - Network:      http://10.0.0.30:3000

 ✓ Starting...
 ✓ Ready in 365ms
  Access to the URL that is shown on the console above from any client computer, and then that's OK if following app is shown.
Matched Content