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?

More than 5 years have passed since last update.

Gitでpullしてnpm runしたらModule not found: Error: が出た時の対処法

0
Posted at

最近、複数人でvueを使った開発を始めたのですが、
PWA対応にしようということで、
Vue.jsプロジェクトのPWA対応
の記事を参考に @vue/cli-plugin-pwaというプラグインを追加してから、
githubのレポジトリにpushしました。

しかし、他の開発者がこの修正をpullした後に、ビルドしたら下記のエラーが出ました。

「Module not found: Error: Can't resolve register-service-worker...以下略」

register-service-workerがインポートできないみたいです。
なんでだろう。

結論から言うと、

npm install

のコマンドで解決しました。

npmを使った開発が初めてで何にもわかってませんでしたが、
git pullしただけでは、プラグインは共同開発者の開発環境には入らないんですね。

ライブラリなどの情報はpackage.jsonファイルに記載されているので、
他の開発者のコミットでこのファイルに修正が入った時は、
git pullした後に、npm installで追加されたライブラリなりなんなりをインストールする必要があったという話でした。

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?