1
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?

You are using Node.js 22.9.0. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.の解消方法

1
Last updated at Posted at 2026-06-28

エラー内容

下記コマンドを入力したらエラーが起きた

コマンドの内容

% npm create vite@latest

> npx
> 'create-vite'

│
◇  Project name:
│  type-class
│
◇  Select a framework:
│  React
│
◇  Select a variant:
│  TypeScript
│
◇  Install with npm and start now?
│  Yes

エラーの内容

You are using Node.js 22.9.0. Vite requires Node.js version 20.19+ or 22.12+. Please upgrade your Node.js version.
file:///Users/ディレクトリ/type-class/node_modules/rolldown/dist/shared/binding-Dh6LYCIB.mjs:509
			const error = /* @__PURE__ */ new Error("Cannot find native binding. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). Please try `npm i` again after removing both package-lock.json and node_modules directory.");

            
Node.js v22.9.0
npm error code 1
npm error path /Users/ディレクトリ
npm error command failed
npm error command sh -c 'create-vite'

# 解消方法

22.12+と書いているからバージョンを上げたらいいのかな?と思い、以下のコマンドを打った

% nodebrew install-binary v22.12.0
%  nodebrew use v22.12.0    
use v22.12.0

さいど同じコマンドを打ったらできた

1
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
1
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?