Debian 12 bookworm
Sponsored Link

Next.js : インストール2023/07/14

React ベースの Web 開発フレームワーク Next.js のインストールです。
[2] 任意の一般ユーザーで Next.js テストアプリケーションを作成します。
mkdir testproject2

cd testproject2
# Next.js アプリケーション [test-app] 作成

npx create-next-app test-app

Need to install the following packages:
Ok to proceed? (y) y
  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 to use `src/` directory? … No / Yes
  Would you like to use App Router? (recommended) … No / Yes
  Would you like to customize the default import alias? … No / Yes
Creating a new Next.js app in /home/debian/testproject2/test-app.

Using npm.


added 119 packages, and audited 120 packages in 17s

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

found 0 vulnerabilities
Initialized a git repository.

Success! Created test-app at /home/debian/testproject2/test-app

cd test-app
# 開発用サーバーを起動

npm run dev

> test-app@0.1.0 dev
> next dev

- ready started server on, url: http://localhost:3000
Attention: Next.js now collects completely anonymous telemetry regarding usage.
This information is used to shape Next.js' roadmap and prioritize features.
You can learn more, including how to opt-out if you'd not like to participate in this anonymous program, by visiting the following URL:

- event compiled client and server successfully in 233 ms (20 modules)
- wait compiling...
- event compiled client and server successfully in 119 ms (20 modules)

# ビルド & プロダクションモードでサーバーを起動

npm run build

> test-app@0.1.0 build
> next build

info  - SWC minify release candidate enabled.
info  - Linting and checking validity of types
info  - Creating an optimized production build
info  - Compiled successfully
info  - Collecting page data
info  - Generating static pages (3/3)
info  - Finalizing page optimization


  (Static)  automatically rendered as static HTML (uses no initial props)
  任意のクライアントコンピューターで表示された URL に Web アクセスして、以下のようなページが表示されれば OK です。