rails sでlocalhost:3000が急に立ち上がらなくなったので解決してみた。 Could not find a JavaScript runtime. See https://github.com/rails/execjs for a list of available runtimes. (ExecJS::RuntimeUnavailable)

表題の様なエラーが突然出て、

localhost:3000

が立ち上がらなくなった。

 

ん?おかしいな、と思ったのは

デプロイ準備中に

Node.jsのインストール

を行ったときのこと。

 

================================================================================

================================================================================

 

                              DEPRECATION WARNING                            

 

  Node.js 6.x LTS Boron is no longer actively supported!

 

  You will not receive security or critical stability updates for this version.

 

  You should migrate to a supported version of Node.js as soon as possible.

  Use the installation script that corresponds to the version of Node.js you

  wish to install. e.g.

 

   * https://deb.nodesource.com/setup_10.x — Node.js v10 LTS "Dubnium" (recommended)

   * https://deb.nodesource.com/setup_12.x — Node.js v12 LTS "Erbium"

 

  Please see https://github.com/nodejs/Release for details about which

  version may be appropriate for you.

 

  The NodeSource Node.js distributions repository contains

  information both about supported versions of Node.js and supported Linux

  distributions. To learn more about usage, see the repository:

    https://github.com/nodesource/distributions

 

================================================================================

================================================================================

 

急にこんなのが現れてパニック笑

 

ある、カリキュラムの通りにやっていたので、何かの間違いかと思い、大混乱笑

 

でも、以前、プロゲートでも教材が間違っていたりふるかったりして、この様なこともあったので、

エラー文からして、

もしかしたらと思って調べてみたら…

 

こんな記事が

 

https://qiita.com/azusanakano/items/771dc9919f347de061d7

 

3年前の記事ですが、どうやら

バージョンが古くてエラーが出てるよ、みたいな内容!

エラー文との意味合いからこれは間違いなさそうっだということで

 

 

Node.js 「推奨バージョン」にアップデートしたら直りました😅

 

https://nodejs.org/ja/

 

こういうことは多分これからもしょっちゅうあると思うので気をつけていきたいと思います🤔