0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【React】Viteを使用しない環境構築

Last updated at Posted at 2025-12-27

やりたいこと

導入

$ curl https://get.volta.sh | bash  # voltaでプロジェクトごとにnode.jsのバージョンを可変可能
$ volta --version
$ volta install node  # node@16などでバージョン指定可能, v24.12.0がインストールされた
$ volta list all

作成・実行

$ npx create-next-app my-app # 新規プロジェクトを作成
$ npm run dev                # 実行

結果

  • 以下のようなページが出ればok (aboutではなく,Nextと表示されればok)
    スクリーンショット 2025-12-27 224633.png

その他

# バージョン対応表
| Next.js |   React |
| ------- | -------- |
| 12.x    | 17 / 18  |
| 13.x    | 18       |
| 14.x    | 18       |
| 15 / 16 | 18 / 19  |
# 確認
npm list react react-dom next

# 削除
npm uninstall react react-dom next

# 入れ直し
npm install react@18 react-dom@18 next@12
$ volta pin node@16   # プロジェクト(my-app)ディレクトリで, node.jsのバージョンを固定可能, package.json内にvoltaを登録,これでmy-appに切り替えるだけでnode.jsのバージョンを切り替え可能
$ volta list          # バージョン確認
# node.jsの削除は,~/.volta/tools/image/から行う

# nvmでnode.jsをインストールする方法
$ nvm install 18      # node.jsのバージョン18をインストール
$ nvm list            # 確認
$ nvm use 18          # 18に切り替える(必要であれば)
0
0
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
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?