0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

SakuraサーバーにNode.jsをインストールする方法

Posted at

目的

  • Node.js v16.17.1(2022/10/13時点の最新版)をSakuraサーバーにインストールする

前提

  • Python3がインストールされていること(Node.jsのコンパイルに必要)

参考サイト

手順

Sakuraサーバーにアクセス

$ ssh <User>@<User>.sakura.ne.jp

Open SSLのコンパイル

$ curl -sSf https://www.openssl.org/source/openssl-1.1.1o.tar.gz -O
$ tar zxf openssl-1.1.1o.tar.gz
$ cd openssl-1.1.1o
$ ./config --prefix=/home/<User>/openssl --openssldir=/home/<User>/local/openssl
$ make
$ make install

Node.jsのコンパイル

$ cd ~/
$ curl -sSf https://nodejs.org/dist/v16.17.1/node-v16.17.1.tar.gz -O
$ tar zxf node-v16.17.1.tar.gz
$ cd node-v16.17.1
$ ./configure --shared-openssl --shared-openssl-includes=/home/<User>/openssl/include/ --shared-openssl-libpath=/home/<User>/openssl/lib
$ export LD_LIBRARY_PATH=/home/<User>/openssl/lib
$ nohup make install DESTDIR=/home/<User>/local &
$ echo "export PATH=$PATH:~/local/bin 
> export LD_LIBRARY_PATH=/home/tsuyoshiterakawa/openssl/lib" >> .bashrc

Pathの設定

$ cd ~/
$ echo "export PATH=$PATH:~/local/bin 
> export LD_LIBRARY_PATH=/home/tsuyoshiterakawa/openssl/lib" >> .bashrc
$ source ~/.bashrc
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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?