LoginSignup
0
0

More than 3 years have passed since last update.

rails c でのwebpacker インストールエラーについて

Last updated at Posted at 2020-03-25
実行コマンド
rails c
エラー
Webpacker configuration file not found[ディレクトリ]

とりあえずwebpacker がないということなのでインストールしてみることにした。

実行コマンド
rails webpacker:install

ノードのバージョンが古いということなので、ノードをインストールし直すこととした。

エラー
Webpacker requires Node.js >= 8.16.0 and you are using 8.11.3
Please upgrade Node.js https://nodejs.org/en/download/

ノードをnodebrewを使って管理

せっかくなので、nodebrewを使ってnodeバージョン管理するように変更することとした。

curl -L git.io/nodebrew | perl - setup
export PATH=$HOME/.nodebrew/current/bin:$PATH

zshのため.zshrcの変更を適応させるようにした。

source ~/.zshrc
nodebrew help

webpackerのインストール

今度は問題なく実行された。

実行コマンド
rails webpacker:install

参考記事

ありがとうございました。

nodebrewでNode.jsをアップデートする

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