Quantcast
Channel: Node.jsタグが付けられた新着記事 - Qiita
Viewing all articles
Browse latest Browse all 8691

rails6を使おうとしたら、Webpackerがインストールできない。

$
0
0

Rails6使いたい

rails6を使ってシステムを使おうとすると、
Webpackerがインストールできない事態に遭遇しました。

rails webpacker:install

してくださいと言われたので、してみると...

sh: /usr/local/heroku/bin/node: cannot execute binary file
sh: nodejs: command not found
Node.js not installed. Please download and install Node.js https://nodejs.org/en/download/

と表示されインストールできません。

Node.jsをサイトからインストールしたり、

alias nodejs='node'

というエイリアスも追加してみましたが、変化はありませんでした。

解決策

sh: /usr/local/heroku/bin/node: cannot execute binary file

上のエラー文がどうやら関係していたようで

rm -rf /usr/local/heroku /usr/local/lib/heroku /usr/local/bin/heroku ~/.local/share/heroku ~/Library/Caches/heroku

上記のコマンドでherokuのアンインストールを試してから
もう一度

rails webpacker:install

してみると

Webpacker successfully installed 🎉 🍰

と表示され見事Webpackerがインストールできました!


Viewing all articles
Browse latest Browse all 8691

Trending Articles