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?

More than 3 years have passed since last update.

React Native (Expo)でFailed building JavaScript bundleが発生する時の対処法

Posted at

テストでexpo installするべきライブラリをnpm installしていたら、以下のようなエラーが出るようになってしまいました。

Unable to resolve module `firebase` from `screens/HogeScreen.tsx`: firebase could not be found within the project.

If you are sure the module exists, try these steps:
 1. Clear watchman watches: watchman watch-del-all
 2. Delete node_modules: rm -rf node_modules and run yarn install
 3. Reset Metro's cache: yarn start --reset-cache
 4. Remove the cache: rm -rf /tmp/metro-*

対処法は上記に書かれている通りですがコピペだと上手くいかなかったので、
コマンドを書き残しておきます。

実行したコマンド

1. watchman watch-del-all
2. rm -rf node_modules
3. yarn install
4. yarn start --reset-cache
5. rm -rf /tmp/metro-*
6. expo start

4を実行すると以下のエラーがでますが上手く実行は出来ているので、
そのまま5-6を進めましょう。

% yarn start --reset-cache                                                  (git)-[master]
yarn run v1.22.10
$ expo start --reset-cache

  error: unknown option `--reset-cache'

error Command failed with exit code 1.

これで6までいったらエラーは治っているはず!

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?