LoginSignup
1

More than 5 years have passed since last update.

IBM i のデフォルトnode.jsバージョンを変更する

Posted at

IBM i 上では複数のnode.jsバージョンをインストールできますが、
そのデフォルトバージョンを切り替える方法を書き留めておきます。

node.jsのインストールディレクトリにnodever.shというシェルスクリプトが用意されています。

CALL QP2TERMでPASEターミナルを開始し、node.jsのインストール・ディレクトリに移動します。
binディレクトリにはnodeやnpmの他にnodever.shが置かれています。

listパラメータを付けて実行すると、対話型でバージョンを変更できます。
表示された一覧の*(アスタリスク)がついているバージョンが現行のnodeバージョンです。

以下はバージョン4からバージョン6へ変更する場合の例です。

$                                                            
cd /QOpenSys/QIBM/ProdData/OPS/Node6/bin                     
$                                                            
ls                                                           
node         node-red     node-red-pi  nodever.sh   npm      
$                                                            
./nodever.sh list                                            
You have the following versions of Node.js installed.        
 [0]  Node.js v0.12.17  with npm v2.15.1        is installed.
*[1]  Node.js v4.6.1    with npm v2.15.9        is installed.
 [2]  Node.js v6.9.1    with npm v3.10.8        is installed.



Select the version of Node.js you want to use: (0~2)         
2                                                            
Node.js v6.9.1  with npm v3.10.8 will now be used. 


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
1