インターネットに接続できないLinux(CentOS7)にnodeJS/npm/jsdoc
nodebrewをインストール
wget git.io/nodebrew -O nodebrew
perl nodebrew setupcurl -L git.io/nodebrew | perl – setup
パスの追加
export PATH=$HOME/.nodebrew/current/bin:$PATH
nodevrewのバージョン確認
nodebrew -v
nodejsインストール
nodebrew install-binary stable 最新版
nodebrew install-binary latest 最新の安定板
nodebrew install-binary v8.9.1 バージョン指定
nodebrew use v17.4.0 利用するバージョンを切り替える
jsdocをnpmを使ってjsdocをインストール
npm i -g jsdoc
nodebrew、nodejs、npm、jsdocはユーザ配下の隠しディレクトリに作られる(.nodebrew .npm)。
インターネットに接続できないサーバなどにnodejs、jsdocを導入したい場合は、これらの隠しファイルを丸ごとコピーすることで使えるようになります。(注意:パーミッションを合わせないと動かない可能性があります)
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 | [root@kgwlocalvm002 out]# jsdoc -h JSDoc 3.6.10 (Tue, 25 Jan 2022 02:05:39 GMT) Options:     -a, --access <value>         Only display symbols with the given access: "package", public", "protected",                                  "private" or "undefined", or "all" for all access levels. Default: all except                                  "private"     -c, --configure <value>      The path to the configuration file. Default: path/to/jsdoc/conf.json     -d, --destination <value>    The path to the output folder. Default: ./out/     --debug                      Log information for debugging JSDoc.     -e, --encoding <value>       Assume this encoding when reading all source files. Default: utf8     -h, --help                   Print this message and quit.     --match <value>              When running tests, only use specs whose names contain <value>.     --nocolor                    When running tests, do not use color in console output.     -p, --private                Display symbols marked with the @private tag. Equivalent to "--access all".                                  Default: false     -P, --package <value>        The path to the project's package file. Default: path/to/sourcefiles/package.json     --pedantic                   Treat errors as fatal errors, and treat warnings as errors. Default: false     -q, --query <value>          A query string to parse and store in jsdoc.env.opts.query. Example:                                  foo=bar&baz=true     -r, --recurse                Recurse into subdirectories when scanning for source files and tutorials.     -R, --readme <value>         The path to the project's README file. Default: path/to/sourcefiles/README.md     -t, --template <value>       The path to the template to use. Default: path/to/jsdoc/templates/default     -T, --test                   Run all tests and quit.     -u, --tutorials <value>      Directory in which JSDoc should search for tutorials.     -v, --version                Display the version number and quit.     --verbose                    Log detailed information to the console as JSDoc runs.     -X, --explain                Dump all found doclet internals to console and quit. Visit https://jsdoc.app/ for more information. [root@kgwlocalvm002 out]# | 
JSDocで出力されたHTMLを表示するために、とりあえずApache(httpd)をインストール
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | [root@kgwlocalvm002 out]# yum list installed | grep httpd [root@kgwlocalvm002 out]# yum install httpd 読み込んだプラグイン:fastestmirror Loading mirror speeds from cached hostfile  * base: ftp.riken.jp  * extras: ftp.riken.jp  * updates: ftp.riken.jp 依存性の解決をしています --> トランザクションの確認を実行しています。 ---> パッケージ httpd.x86_64 0:2.4.6-97.el7.centos.4 を インストール --> 依存性の処理をしています: httpd-tools = 2.4.6-97.el7.centos.4 のパッケージ: httpd-2.4.6-97.el7.centos.4.x86_64 --> 依存性の処理をしています: /etc/mime.types のパッケージ: httpd-2.4.6-97.el7.centos.4.x86_64 --> トランザクションの確認を実行しています。 ---> パッケージ httpd-tools.x86_64 0:2.4.6-97.el7.centos.4 を インストール ---> パッケージ mailcap.noarch 0:2.1.41-2.el7 を インストール --> 依存性解決を終了しました。 依存性を解決しました ======================================================================================================================== Package                     アーキテクチャー       バージョン                            リポジトリー             容量 ========================================================================================================================インストール中:  httpd                       x86_64                 2.4.6-97.el7.centos.4                 updates                 2.7 M 依存性関連でのインストールをします:  httpd-tools                 x86_64                 2.4.6-97.el7.centos.4                 updates                  94 k  mailcap                     noarch                 2.1.41-2.el7                          base                     31 k トランザクションの要約 ========================================================================================================================インストール  1 パッケージ (+2 個の依存関係のパッケージ) 総ダウンロード容量: 2.8 M インストール容量: 9.6 M Is this ok [y/d/N]: y Downloading packages: (1/3): mailcap-2.1.41-2.el7.noarch.rpm                                                           |  31 kB  00:00:00 (2/3): httpd-tools-2.4.6-97.el7.centos.4.x86_64.rpm                                              |  94 kB  00:00:00 (3/3): httpd-2.4.6-97.el7.centos.4.x86_64.rpm                                                    | 2.7 MB  00:00:00 ------------------------------------------------------------------------------------------------------------------------合計                                                                                    3.7 MB/s | 2.8 MB  00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction   インストール中          : mailcap-2.1.41-2.el7.noarch                                                             1/3   インストール中          : httpd-tools-2.4.6-97.el7.centos.4.x86_64                                                2/3   インストール中          : httpd-2.4.6-97.el7.centos.4.x86_64                                                      3/3   検証中                  : httpd-tools-2.4.6-97.el7.centos.4.x86_64                                                1/3   検証中                  : mailcap-2.1.41-2.el7.noarch                                                             2/3   検証中                  : httpd-2.4.6-97.el7.centos.4.x86_64                                                      3/3 インストール:   httpd.x86_64 0:2.4.6-97.el7.centos.4 依存性関連をインストールしました:   httpd-tools.x86_64 0:2.4.6-97.el7.centos.4                        mailcap.noarch 0:2.1.41-2.el7 完了しました! [root@kgwlocalvm002 out]# httpd -v Server version: Apache/2.4.6 (CentOS) Server built:   Jan 25 2022 14:08:43 [root@kgwlocalvm002 out]# | 
Apacheの自動起動設定
| 1 2 3 4 5 6 | [root@kgwlocalvm002 out]#  chkconfig httpd on 情報:'systemctl enable httpd.service'へ転送しています。 Created symlink from /etc/systemd/system/multi-user.target.wants/httpd.service to /usr/lib/systemd/system/httpd.service.[root@kgwlocalvm002 out]#  chkconfig httpd off 情報:'systemctl disable httpd.service'へ転送しています。 Removed symlink /etc/systemd/system/multi-user.target.wants/httpd.service. [root@kgwlocalvm002 out]# |