简体   繁体   English

如何在没有互联网且没有root权限的情况下在redhat上安装nodejs?

[英]How to install nodejs on redhat without internet and without root permission?

What is the best way that Node.js can be installed on linux without internet nor root permissions. Node.js 可以在没有互联网或 root 权限的情况下安装在 linux 上的最佳方式是什么。 So far I just downloaded the source tar.gz and tar.xz files.到目前为止,我刚刚下载了源 tar.gz 和 tar.xz 文件。

To install nodejs on linux without root permission and offline在没有root权限和离线的linux上安装nodejs

Download the tar.xz from Linux Binaries(x64) @ https://nodejs.org/en/download/从 Linux Binaries(x64) @ https://nodejs.org/en/download/下载 tar.xz

Then in ~.bashrc add:然后在 ~.bashrc 添加:

NODE_HOME=~/apps/node-v12.18.3-linux-x64
PATH=$NODE_HOME/bin:$PATH

Source the bashrc file or restart terminal and you are done获取 bashrc 文件或重新启动终端,您就完成了

source .bashrc

Try尝试

node --version
npm -v

You can download the rpm from nodesource website for specific redhat version and specific node version ex: https://rpm.nodesource.com/pub_14.x/el/7/x86_64/ provides the rpm for node 14 on redhat 7您可以从 nodesource 网站下载特定 redhat 版本和特定节点版本的 rpm,例如: https://rpm.nodesource.com/pub_14.x/el/7/x86_64/在 redhat 7 上提供节点 14 的 rpm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM