なでしこ公式サイトには「CentOS」に入れる方法が記載されています。
【重要ポイント】
Nodejsは、インストール時に実行した時のカレントディレクトリ配下になるのでインストールするディレクトリを予め考えておきましょう。(私は専用フォルダを作成して、そこにインストールして、やり直しました。。。。)
例)ユーザー「nadesiko」を作成してパスワードを設定します。
>useradd nadesiko
>passwd nadesiko
Changing password for user nadesiko.
New password:nade1234
Retype new password:nade1234
passwd: all authentication tokens updated successfully.
※インストールするディレクトリを選んで移動します。(必須です)
>cd /home/nadesiko
※noudejsをインストールする時に、「/home」以外のディレクトリは、権限を「777」にしてからインストールしてください。
例>chmod 777 /var/www
場所を決めたらインストールします。
>yum install nodejs
「nodejs.x86_64 1:6.17.1-1.el7」がインストールされました。
Node.jsを最新版にします。
>npm install n -g
>n stable
installing : node-v14.17.1
mkdir : /usr/local/n/versions/node/14.17.1
fetch : https://nodejs.org/dist/v14.17.1/node-v14.17.1-linux-x64.tar.xz
installed : v14.17.1 (with npm 6.14.13)
Note: the node command changed location and the old location may be remembered i n your current shell.
old : /usr/bin/node
new : /usr/local/bin/node
To reset the command location hash either start a new shell, or execute PATH=”$P
NodejsのPATHを設定します。
>ln -sf /usr/local/bin/node /usr/bin/node
>ln -sf /usr/local/bin/npm /usr/bin/npm
念のため、npmも更新します。
>npm update -g npm
なでしこ3をダウンロードするので、3つ方法がありまして。(どれがいいのだろうか?)
①npm経由でなでしこ3をインストールする
②ローカルインストールする
③Gitリポジトリからのインストールする
悪魔の三択です(w
理想を言えば、いったん入れた「なでしこ3」をいつでもアップデートできるような仕組みが欲しいのですが。
例)yum update 等
よくわからない場合は中間を取る事にしています(ローカルインストール)
>npm install nadesiko3
npm WARN saveError ENOENT: no such file or directory, open ‘/package.json’
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open ‘/package.json’
npm WARN !invalid#1 No description
npm WARN !invalid#1 No repository field.
npm WARN !invalid#1 No README data
npm WARN !invalid#1 No license field.
+ nadesiko3@3.2.15
added 109 packages from 67 contributors and audited 109 packages in 10.21s
4 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
成功したの。。。かな?その4に続きます。