12
5

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.

Error: Cannot find module '@babel/core'

Posted at

前提

gulpでbabelを使ってコンパイルしたい。
ということでインストールを進めたがエラーが出た。

エラーメッセージ

error.log
Error: Cannot find module '@babel/core'

対処法

当初以下のコマンドを実行するも状況は変わらず

installbabelcore.shell
npm install --save-dev babel-core babel-preset-env

babel7以上の以下のコマンドを実行

installbabelcore7.shell
npm install --save-dev @babel/core @babel/preset-env

無事@babel/coreがnode_modulesディレクトリにインストールされ
gulpからbabelでコンパイルが通るようになった。

環境

gulp4.0.1

参考URL

インストール時参考にさせていただきました。
https://qiita.com/gigazombie/items/4227cdf25580a6c539f8

エラーメッセージで参考にさせていただきました。
https://github.com/babel/gulp-babel/issues/124

12
5
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
12
5

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?