0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【Next.js】yarnでnextjs + typescriptをインストールしてみた

Last updated at Posted at 2024-05-02

はじめに

yarnでnextjsをインストールしてみたのでの備忘録として書き留めておく。

1. yarnのインストール

インストールコマンドを実行する。

sudo npm install -g yarn

正常にインストールされたか確認する。

# バージョン確認
yarn -v

#実行結果
1.22.22

2.nextjs + typescript環境作成

以下コマンドを実行

yarn create next-app --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

下記メッセージが出力されたらとりあえずOK。

Success! Created samplenextjs at ディレクトリパス

✨  Done in 122.95s.

3. 画面で確認

下記コマンドを実行する。

yarn dev

その後下記URLへアクセス。

http://localhost:3000

下記画面が表示されれば完了。
sample.png

終わりに

nextjsかっこいい。。。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?