1
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

expo-cliというかnpmでconfigure errorが出たときの対応

Posted at

いつも使ってるexpo-cliを利用しようとしたら、下記のようなエラーに遭遇した。

gyp WARN EACCES current user ("nobody") does not have permission to access the dev dir "/Users/xxxxxx/Library/Caches/node-gyp/12.3.1"
gyp WARN EACCES attempting to reinstall using temporary dev dir "/Users/xxxxxx/.anyenv/envs/nodenv/versions/12.3.1/lib/node_modules/expo-cli/node_modules/chokidar/node_modules/fsevents/.node-gyp"
gyp WARN install got an error, rolling back install
gyp WARN install got an error, rolling back install
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/Users/xxxxxx/.anyenv/envs/nodenv/versions/12.3.1/lib/node_modules/expo-cli/node_modules/chokidar/node_modules/fsevents/.node-gyp'
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/Users/xxxxxx/.anyenv/envs/nodenv/versions/12.3.1/bin/node" "/Users/xxxxxx/.anyenv/envs/nodenv/versions/12.3.1/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/xxxxxx/.anyenv/envs/nodenv/versions/12.3.1/lib/node_modules/expo-cli/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v12.3.1
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok

結論から言えば、下記のように--unsafe-permオプションをつけて実行すればインストール自体はできた。

sudo npm install --unsafe-perm -g expo-cli

基本的にroot権限でnpm installすることは推奨されていないようで、場合により--unsafe-permオプションが必要なようです。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?