LoginSignup
0
0

npm install でEEXISTエラーが出たときの対応

Last updated at Posted at 2023-06-03

expo / react / react-nativeをバージョン指定してインストールした

npm install expo@47 react@18.1.0 react-native@0.70.5

こんなエラーが出た

npm ERR! code EEXIST
npm ERR! syscall rename
npm ERR! path ...省略...
npm ERR! dest ...省略...
npm ERR! errno EEXIST
npm ERR! Invalid response body while trying to fetch https://registry.npmjs.org/@urql%2fcore: EACCES: permission denied, rename '...省略...' -> '...省略...'
npm ERR! File exists: ...省略...
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in: ...省略....

解決方法

EEXISTでググってみると、「既にファイルが存在する」ということらしい。
▼ソース
https://linuxjm.osdn.jp/html/LDP_man-pages/man3/errno.3.html

npm ERR! Remove the existing file and try again, or run npm
// => 既に存在しているファイルを削除して、再度npmコマンドを実行してください

とあるので言われた通りにしてもいいのだが、その1行前で「permission denied,」と言われているので、とりあえずsudoで再度コマンドを実行してみた。

sudo npm install expo@47 react@18.1.0 react-native@0.70.5

これで無事にインストールできました。

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