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
これで無事にインストールできました。