How to install nodejs on redhat without internet and without root permission? - node.js

What is the best way that Node.js can be installed on linux without internet nor root permissions.
So far I just downloaded the source tar.gz and tar.xz files.

To install nodejs on linux without root permission and offline
Download the tar.xz from Linux Binaries(x64) # https://nodejs.org/en/download/
Then in ~.bashrc add:
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
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

Related

NodeJS on Windows 10 and Windows Subsystem for Linux

I'm trying to get Expo, a platform for making native mobile apps, to run on a Windows 10 machine. A preprequisite for Expo is NodeJS so I installed that. However, I ran into some issues getting Expo to work using Git Bash and so now I'm trying to get Windows Subsystem for Linux (WSL) operational to use that instead. Ubuntu 18.04 LTS has been downloaded and initialized. Using a CMD here is what's happening:
C:\Users\jason.black>node -v
v12.13.0
C:\Users\jason.black>wsl
jason#PC1:/mnt/c/Users/jason.black$ node -v
Command 'node' not found, but can be installed with:
sudo apt install nodejs
jason#PC1:/mnt/c/Users/jason.black$ sudo apt install nodejs
[sudo] password for jason:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package nodejs
jason#PC1:/mnt/c/Users/jason.black$
So it appears that NodeJS which was initially installed is not available to WSL. Does that seem right? And why won't it install so WSL can access it?
If you're trying to access Node installed on the windows site, you may specify the PATH to /mnt/x/.../path/to/node/bin; if you're trying to install nodejs on the Linux side, may be you're looking for the package 'node' (not nodejs), or you can just download the portable version: https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.xz
For someone who's not familiar to Linux:
# will be download to home directory
cd ~
# using wget
wget https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.xz
# using curl
curl -o node-v12.13.1-linux-x64.tar.xz https://nodejs.org/dist/v12.13.1/node-v12.13.1-linux-x64.tar.xz
# extract
tar xf node-v12.13.1-linux-x64.tar.xz

Config file changes when moving from Windows to Linux

Our project has been moved from windows server to linux server. In windows "config.php" file, the packages installed is defined as:
define('HTML2TEXT_PATH', "c:\\catsbin\\html2text.exe");
How to give the path when moved to linux server?
I have the same package installed in linux with the command
sudo apt-get install html2text
and it is located at /usr/share/doc/html2text/changelog.Debian.gz.
Thanks in advance.

Install Node.js with downloaded binary on Ubuntu Desktop.. Where do the files go?

I've downloaded Node.js directly from https://nodejs.org/en/ onto my Ubuntu Desktop operating system. I can easily unpackage the node-vX.X.0-linux-x64.tar.xz file, and I can see node directories: bin, include, lib, share. I'm guessing my download folder, ~/Downloads/node-vX.X.0-linux-x64, is not going to be the final installation location.
My guess would be to copy all of the directory over to /usr/bin/node/node-vX.X.-linux-x64 but I'm not really sure.
Where do these files go? (I've tried the readme.md file in the download and the docs on that site. I would have thought something, somewhere on nodejs.org would have offered a bit of help...)
Is there a special installation step required here?
I wrote a tutorial to do exactly what you're asking: How to get Node 6.7.0 on Linux -
it's about Node 6.7.0 but you can just change the version number.
In short:
First get the files:
# If you have a 64-bit system then download binary package:
wget https://nodejs.org/dist/v6.7.0/node-v6.7.0-linux-x64.tar.gz
# If you have a 32-bit system then download a different version:
wget https://nodejs.org/dist/v6.7.0/node-v6.7.0-linux-x86.tar.gz
Extract:
# Extract what you downloaded:
tar xzvf node-v6.7.0-linux-x64.tar.gz
# Change the file ownership:
sudo chown -Rv root.root node-v6.7.0-linux-x64
Then install in ONE of the locations:
# Install files in /usr/local
sudo cp -Rvi node-v6.7.0-linux-x64/{bin,include,lib,share} /usr/local
# (change -Rvi to -Rvf if you want to overwrite existing files)
# Install files in /opt/node
sudo cp -Rvi node-v6.7.0-linux-x64 /opt/node
# Install files in /opt/node-6.7.0
sudo cp -Rvi node-v6.7.0-linux-x64 /opt/node-6.7.0
The difference between those 3 locations in the example is explained better in the article. The consequences are mostly related to PATH and installing multiple versions.
Finish the setup:
You need to make sure that directory where you have the node and npm binaries is in your PATH. See my tutorial for details on how to do that.
Beware of shebang lines:
The shebang line of npm in Node installed from binaries is different than when installed from sources. This is one of the reasons I recommand building from sources if you have time for that. The other reason is that installing from sources you can do make test to test the version of Node on your specific system, which you cannot do when installing from binaries or with nvm.

How to install Sqelectron in Linux?

I'm a new Linux user and I want to install a MySQL IDE. I use Sqlectron in Windows, so I want to install this IDE now in my Linux computer. I downloaded the .zip file but I don't know what to that after unzip it.
I'm using Elementary OS based on Ubuntu
The latest version of sqlectron has a .deb file to install in debian like distro https://github.com/sqlectron/sqlectron-gui/releases/latest
To install sql electron goto https://github.com/sqlectron/sqlectron-gui/releases/tag/v1.35.0
find packages depending on your distro either deb, or rpm
for deb
sudo dpkg -i path/to/package_file.deb
for rpm
rpm -ivh path/to/package.rpm
Alternatively, you can double click the downloaded sqlectron*** .deb package and do a GUI based installation in Linux.

Problems installing Pycharm

I am trying to install pycharm on my linux OS.
following the instructions pycharm/dowload.
Since I run a linux machine I made sure the pychrarm files in the current directory:
ietX220:~$ ls
Desktop pycharm-community-4.0.1
Documents Music
pycharm-community- 4.0.1.tar.gz
Downloads New Folder Templates
Dropbox octave-workspace Videos
examples.desktop Pictures VirtualBox VMs
jdk1.8.0_25 Public Win7-PV2hh-6c3HY-
QJHM9-8RJJH-P86W8.iso
ietX220:~$ pycharm-*.tar.gz
pycharm-community-4.0.1.tar.gz: command not found
As you can see the pycharm file is in the current(home) directory but is not found.
Then I opened the tar file made pycharm.sh executable:
chmod +x pycharm.sh
And then ran:
~/pycharm-community-4.0.1/bin$ ./pycharm.sh
Startup Error: Application cannot start in headless mode
What am I doing wrong?
I am having the same issue. It looks like maybe you and I both have a minimal (headless) Java install on our systems. Use your system's method for finding installed packages and search for Java, and i'll bet you find only openjdk-headless
yum list installed | grep openjdk
# or on debian-based systems
# dpkg --get-selections | grep openjdk
# =>java-1.7.0-openjdk-headless
Solution then is to install the same package without the "-headless" suffix.
Here's where I am getting my information for the solution: https://bugzilla.redhat.com/show_bug.cgi?id=1177379
I had the same problem and as mentioned before the error was that openjdk was headless. What i did is i installed from the begining openjdk using the command apt-get install default-jdk (for ubuntu). I know it's not the best way to do it, however it is rather quick and simple.
If you have already all the prerequisites (such as Java) installed, try out charmy (PyCharm installer for Linux).
virtualenv charmy-env
source charmy-env/bin/activate
pip install charmy
charmy install
That will install PyCharm into your home directory. It will also simplify your feature PyCharm upgrades. To upgrade you would just have to type
charmy install
instead of downloading distribution manually, unpacking it, etc.
See https://pypi.python.org/pypi/charmy for more.
PYcharm is now available as a snap. Can be easily installed as below
sudo apt update && sudo apt install snapd
Then the community edition can be installed by
sudo snap install pycharm-community --classic
The classic escape is to get snaps that have been published with classic confinements
220:~$ pycharm-*.tar.gz
pycharm-community-4.0.1.tar.gz: command not found
gz files are not executable files. I think the current directory is not in your PATH variable. To get around that you would do "./pycharm-community-3.0.1.tar.gz" and you should see the message "Permission denied" as the gz file would not have execute permission. And if you gave it execute permission it would say "cannot execute binary file: Exec format error".
These are the instructions from the JetBrains website:
Copy the pycharm-*.tar.gz to the desired installation location
(make sure you have rw permissions for that directory)
Unpack the pycharm-*.tar.gz using the following command:
tar xfz pycharm-*.tar.gz
Remove the pycharm-*.tar.gz to save disk space (optional)
Run pycharm.sh from the bin subdirectory
NOTE: PyCharm on Linux doesn't need special installation or running
any installation script. It runs out of the pycharm-*.tar.gz
If you run the command "tar xfz pycharm-*.tar.gz" you should end up with a directory in your current directory named "pycharm-community-4.0.3".
If you cd pycharm-community-4.0.3/bin, "ls -al" should show that pycharm.sh is already executable. Run pycharm.sh and you should be done. The script will prompt for a password at the end so it can put a startup script in a system directory. You must have admin privileges for that part to work. But if you don't, you can still start PyCharm by executing "[path to pycharm directory]/bin/pycharm.sh &" at the command prompt.
I am not sure what the "NOTE:" is saying, but I would ignore it as you get a working PyCharm by doing what it says above the NOTE: .
Setup the newest stable jdk(like jdk1.7 or jdk 1.8) in your system, and set it is the default jdk.
1.download JDK8
2.SET JAVA HOME
sudo gedit /etc/environment
export JAVA_HOME=/home/username/Java/jdk1.8
export JRE_HOME=/home/username/Java/jdk1.8
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
sudo gedit /etc/profile
//before umask xxx adde
export JAVA_HOME=/home/username/Java/jdk1.8
export CLASSPATH=$CLASSPATH:$JAVA_HOME/lib:$JAVA_HOME/jre/lib
export PATH=$JAVA_HOME/bin:$JAVA_HOME/jre/bin:$PATH:$JAVA_HOME/bin
3. run pycharm
./pycharm.sh

Resources