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?

Error: Cannot find native binding. npm has a bug related to optional dependencies

0
Posted at

はじめに

react-serverというossのリポジトリをローカルで動かそうとした時にエラーが出たので記事にします。

問題

リポジトリをクローンしてこの箇所のセットアップをやっていた際にpnpm testの箇所で以下のエラーが出る。サーバーを立ち上げた際も同じ。

Error: Cannot find native binding. npm has a bug related to optional dependencies

原因と解決策

ローカルに入っていたnodeのバージョンが古く一部のモジュールが適切にインストールされていなかったのが原因でした。以下のようにnodeのバージョンを新しくしてセットアップし直すと無事動きました。

% nvm install 24
% nvm use 24
% corepack enable
% pnpm i

おわりに

node_modulesやキャッシュを消して入れ直してもなおらず少し時間かかりました。

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?