Install node js on centos - node.js

To install node js. I am referring this url https://www.digitalocean.com/community/tutorials/how-to-install-node-js-on-a-centos-7-server
but when I try extract source with this command tar xzvf node-v* && cd node-v*
I get error tar: node-v4.2.3-linux-x64/bin/npm: Cannot create symlink to../lib/node_modules/npm/bin/npm-cli.js': Protocol error`

INSTALLING NODE.JS FROM EPEL REPOSITORY
An alternative method of installing node.js is from the Epel Repository that is available for CentOS and other linux distro's. To get access to the repo you must first install the epel-release by.
sudo yum install epel-release
Press y for yes and let it install.
After that you can just install node.js from yum.
sudo yum install nodejs
To verify the installed version you can do.
node --version
Refer : https://www.vpsserver.com/community/tutorials/20/install-node-js-on-centos-7/

try this !
sudo tar --strip-components 1 -xzvf node-v* -C /usr/local

Related

Install nodejs 4 on redhat

Nodejs version 4 has been released and installed on my windows machine.
I'm trying to install the package trough yum on redhat but i'm not getting the latest version.
i tried: sudo yum install -y nodejs but the lastest 4.0 version is not installed.
How do i install nodejs 4.0 on a redhat machine?
NodeJS 4.X for EL7 repos located at https://rpm.nodesource.com/pub_4.x/el/7/
To install with yum change baseurl in nodesource-el.repo file to:
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/$basearch
/etc/yum.repos.d/nodesource-el.repo content:
[nodesource]
name=Node.js Packages for Enterprise Linux 7 - $basearch
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
[nodesource-source]
name=Node.js for Enterprise Linux 7 - $basearch - Source
baseurl=https://rpm.nodesource.com/pub_4.x/el/7/SRPMS
failovermethod=priority
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/NODESOURCE-GPG-SIGNING-KEY-EL
gpgcheck=1
You can compile and install from its source.
ver=4.0.0
wget -c https://nodejs.org/dist/v$ver/node-v$ver.tar.gz #This is to download the source code.
tar -xzf node-v$ver.tar.gz
cd node-v$ver
./configure && make && sudo make install
https://github.com/nodejs/node-v0.x-archive/wiki/Installation
Try npm install n -g and then n latest for downloading it with this version manager.
Edit:
The official distributions are managed by Nodesource. For RHEL the setup is supposed to be (take from the repo):
Current instructions for installing, as listed on the Node.js Wiki:
Note that the Node.js packages for EL 5 (RHEL5 and CentOS 5) depend on the EPEL repository being available. The setup script will check and provide instructions if it is not installed.
Run as root on RHEL, CentOS, CloudLinux or Fedora:
curl -sL https://rpm.nodesource.com/setup | bash -
Then install, as root:
yum install -y nodejs
But be aware that 4.0 is currently not in their rpm distribution
This was my solution and it worked:
Distrubution url: Distr: https://nodejs.org/dist/v4.2.1/node-v4.2.1.tar.gz (v4.2.1 for now)
Unpack the package (tar Jxf node-v4.2.1.tar.xz).
Some package could be too old and will cause problems during installation.
cd to the unpacked file and run ”./configure”. if the warming “C++ compiler too old, need g++ 4.8 or clang++ 3.4” is displayed you need to execute the following commands:
curl http://linuxsoft.cern.ch/cern/scl/slc6-scl.repo > /etc/yum.repos.d/slc6-scl.repo
rpm --import http://ftp.mirrorservice.org/sites/ftp.scientificlinux.org/linux/scientific/51/i386/RPM-GPG-KEYs/RPM-GPG-KEY-cern
yum install -y devtoolset-3
And to utilize it without having to set environment variables execute this command:
scl enable devtoolset-3 bash
Now restart the process:
./configure
make
make install
You can try this solution.
First, update software repository to the latest versions:
yum -y update
Intall "Development Tools". It's a group of tools for compiling software from sources.
yum -y groupinstall "Development Tools"
Move to /usr/src directory - the usual place to hold software sources.
cd /usr/src
Now, we pick the latest compressed source archive from Node.js website at http://nodejs.org/download/.
wget http://nodejs.org/dist/v4.2.4/node-v4.2.4.tar.gz
tar zxf node-v4.2.4.tar.gz
cd node-v4.2.4
./configure
make
make install

subvertpy install with reviewboard on SUSE

i installed subvertpy, and looks successfully.
Searching for subvertpy
Best match: subvertpy 0.9.1
Processing subvertpy-0.9.1-py2.6-linux-x86_64.egg
subvertpy 0.9.1 is already the active version in easy-install.pth
Installing subvertpy-fast-export script to /usr/local/bin
Using /usr/local/lib64/python2.6/site-packages/subvertpy-0.9.1-py2.6-linux-x86_64.egg
Processing dependencies for subvertpy
Finished processing dependencies for subvertpy
but when i tried to add a svn repository, it shows
The Python module "subvertpy" is not installed.You may need to restart the server after installing it.
is there anything i should configure in apache???
Install pysvn
apt-get install subversion python-svn
or
yum --enablerepo=epel install pysvn
also you can try
sudo yum install -y subversion-devel
wget http://pysvn.barrys-emacs.org/source_kits/pysvn-1.7.6.tar.gz
tar xf pysvn-1.7.6.tar.gz
(cd pysvn-1.7.6; cd Source;python setup.py backport;python setup.py configure;make;)
# copy
PythonLib="/usr/lib64/python2.6/site-packages/pysvn"
sudo mkdir -p ${PythonLib}
sudo cp pysvn-1.7.6/Source/pysvn/__init__.py ${PythonLib}
sudo cp pysvn-1.7.6/Source/pysvn/_pysvn*.so ${PythonLib}

node js can't install right on my Ubuntu computer

I use the git to install node js, the method I use is below:
mkdir ~/local
echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc
. ~/.bashrc
git clone git://github.com/joyent/node.git
cd node
./configure --prefix=~/local
make install
cd ..
After this, I use node on my command line, it tell me no node.Any one can help me?
I got the method form https://gist.github.com/isaacs/579814, but can't work.
My path is here.
You have to make before you make install.
The wiki has more information about building from source.
I used NVM to install Node.js to my Ubuntu computer:
First install these packages
sudo apt-get install curl build-essential libssl-dev libxml2 libxml2-dev libexpat1-dev
Install nvm
git clone https://github.com/creationix/nvm.git ~/.nvm
To activate nvm, you need to source it from your bash shell (e.g, add to your ~/.bash_profile)
. ~/.nvm/nvm.sh
The following steps are also required when upgrading Node
Install Node (use whichever version you like, but v0.8.x works)
nvm install v0.8.23
nvm alias default v0.8.23
nvm use v0.8.23
Any issues, I would check out the NVM repo.
This is my build script for node.js on ubuntu. I don't build from the bleeding edge most recent code, but its close to your process.
sudo apt-get update
sudo apt-get -y install build-essential libssl-dev
wget http://nodejs.org/dist/latest/docs/
node_version=`grep -i 'current version' index.html | sed -E 's/.*([0-9]+\.[0-9]+\.[0-9]+).*/\1/'`
wget http://nodejs.org/dist/v$node_version/node-v$node_version.tar.gz
tar -xzf node-v$node_version.tar.gz
cd node-v$node_version
./configure
make
sudo make install
cd ..
rm -rf node-v$node_version.tar.gz node-v$node_version index.html

Installing the libs3 on linux

Could someone pls give me a detailed procedure to intsall libs3 on LINUX? Just the procedure will do.
Thanks in advance.
These are the instructions to install libs3 on centos on a 64 bit machine.
According to their README, you are supposed to build an rpm package out of their source code using 'rpmbuild -ta '
1.) So first, install rpmbuild if it isn't installed already. [My install location is the default one: ~/rpmbuild]
2.) Clone libs3.
git clone https://github.com/bji/libs3.git
3.) Rename folder as libs3-trunk [rpmbuild complained if its name wasn't that, so...], create a tar.gz, copy it to SOURCES folder inside rpmbuild directory.
mv libs3 libs3-trunk
tar -zcvf libs3-trunk.tar.gz libs3-trunk/
mv libs3-trunk.tar.gz ~/rpmbuild/SOURCES
cd ~/rpmbuild/SOURCES
4.) Build the rpm
rpmbuild -ta libs3-trunk.tar.gz
cd ../RPMS/x86_64
5.) Install dependency libs3-2-2.0-5.1.x86_64.rpm from
[http://rpm.pbone.net/index.php3/stat/4/idpl/21900926/dir/centos_6/com/libs3-2-2.0-5.1.x86_64.rpm.html] OR [ftp://ftp.pbone.net/mirror/ftp5.gwdg.de/pub/opensuse/repositories/home:/dalgaaf:/ceph:/extra/CentOS_CentOS-6/x86_64/libs3-2-2.0-5.1.x86_64.rpm]
6.) Install the rpm:
Execute following as sudo:
rpm -Uvh libs3-2-2.0-5.1.x86_64.rpm
rpm -Uvh --replacefiles libs3-trunk-1.x86_64.rpm
rpm -Uvh libs3-devel-trunk-1.x86_64.rpm
7.) Install libcurl-devel/libxml2-devel through yum if you get following error:
make: curl-config: Command not found
make: xml2-config: Command not found
sudo yum install libcurl-devel.x86_64
sudo yum install libxml2-devel.x86_64
For ubuntu versions >=14.04, libs3-dev is available as an Ubuntu package.
So you just need to run:
sudo apt-get install libs3-dev

How can I set up & run PhantomJS on Ubuntu?

I set up PhantomJS and recorded it to video: https://www.dailymotion.com/video/xnizmh_1_webcam
Build instructions: http://phantomjs.org/build.html
Is there anything wrong in my setup?
After I set it up I read the quick start tutorial and tried to write this code
phantomjs hello.js
It gives me "command not found" error. How can I solve this problem?
Guidouil's answer put me on the right track. I had to add one additional symlink to /usr/bin/, and I did direct symlinks for all 3 - see below.
I'm installing on Ubuntu server Natty Narwhal.
This is exactly what I did.
cd /usr/local/share
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.7-linux-x86_64.tar.bz2
sudo tar xjf phantomjs-1.9.7-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.7-linux-x86_64/bin/phantomjs /usr/bin/phantomjs
And finally when I do
phantomjs -v
I get 1.9.7
If anyone sees any problems with what I've done, please let me know.
PhantomJS is on npm. You can run this command to install it globally:
npm install -g phantomjs-prebuilt
phantomjs -v should return 2.1.1
download from phantomjs website the prebuilt package :
http://phantomjs.org/download.html
then open a terminal and go to the Downloads folder
sudo mv phantomjs-1.8.1-linux-x86_64.tar.bz2 /usr/local/share/.
cd /usr/local/share/
sudo tar xjf phantomjs-1.8.1-linux-x86_64.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.8.1-linux-x86_64 /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
then to check install phantomjs -v should return 1.8.1
Install from package manager:
sudo apt-get install phantomjs
Here are the build steps I used (note these instructions are for version 1.3. See comments to this answer for the installation instructions of the latest PhantomJS):
sudo apt-get update
sudo apt-get install git-core
sudo apt-get install build-essential
sudo apt-get install libqt4-dev libqtwebkit-dev qt4-qmake
git clone git://github.com/ariya/phantomjs.git && cd phantomjs
git checkout 1.3
qmake-qt4 && make
Now install Xvfb
sudo apt-get install xvfb xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
Launch Xvfb:
Xvfb :23 -screen 0 1024x768x24 &
Now run phantom:
DISPLAY=:23 ./phantomjs hello.js
For PhantomJS version above 1.5, consider this (verbatim copy of the build instructions on the phantom website):
For Ubuntu Linux (tested on a barebone install of Ubuntu 10.04 Lucid
Lynx and Ubuntu 11.04 Natty Narwhal):
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.7
./build.sh
For Ubuntu you can use the prebuilt versions downloadable from the PhantomJS site.
If you have some serious time on your hands you can also build it yourself. (This is exactly the procedure from Nikhil's answer).
The guys over at PhantomJS recommend using the binaries to save time:
Warning: Compiling PhantomJS from source takes a long time, mainly due to thousands of files in the WebKit module. With 4 parallel compile jobs on a modern machine, the entire process takes roughly 30 minutes. It is highly recommended to download and install the ready-made binary package if it is available.
With a modern machine they mean > 4 cores, > 8gb mem I think. I tried it on a micro AWS instance and gave up after 2 hours.
In short: install the prebuilt packages from the PhantomJS site per their instructions.
Personaly I prefer using npm (see Arnel Bucio answer)
sudo npm install -g phantomjs
but! I noticed that some of npm module still can't see it as global executable.
so!
Create new /usr/share/phantomjs/ directory link
cd /usr/share
sudo ln -s ../lib/node_modules/phantomjs/lib/phantom phantomjs
Remove old /usr/bin/phantomjs executable link and create the new one
cd /usr/bin
sudo mv phantomjs phantomjs.old
sudo ln -s ../share/phantomjs .
in my vagrant bootstrap:
apt-get install -y build-essential chrpath git-core libssl-dev libfontconfig1-dev
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.9
echo y | ./build.sh
ln -s /home/vagrant/phantomjs/bin/phantomjs /usr/local/bin/phantomjs
cd ..
I have done with this.
sudo apt-get update
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.9
./build.sh
See link
Installation guide is in ...
https://gist.github.com/julionc/7476620
And run in terminal with this command
phantomjs --webdriver=4444
From the official site: phantomjs site
sudo apt-get install build-essential chrpath git-core libssl-dev libfontconfig1-dev
git clone git://github.com/ariya/phantomjs.git
cd phantomjs
git checkout 1.8
./build.sh
For Ubuntu, download the suitable file from http://phantomjs.org/download.html. CD to the downloaded folder. Then:
sudo tar xvf phantomjs-1.9.0-linux-x86_64.tar.bz2
sudo mv phantomjs-1.9.0-linux-x86_64 /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs/bin/phantomjs /usr/bin/phantomjs
Make sure to replace the file name in these commands with the file you have downloaded.
Be aware this is definitely one way to do it:
$ sudo apt-get install phantomjs
$ phantomjs -v
1.6.0
Sadly, it installs 1.6 and not the latest one, but this works for my purposes.
I know this is too old, but, just i case someone gets to this question from Google now, you can install it by typing apt-get install phantomjs
On Ubuntu for Windows, I found neither apt-get nor npm versions worked for me. What worked was the script from this comment.
For ease of use, I pasted the whole thing into a script file called install_phantomjs.sh, made it executable (chmod u+x install_phantomjs.sh), and then ran it (./install_phantomjs.sh)
Or the latest - 32bit version Linux
sudo wget http://phantomjs.googlecode.com/files/phantomjs-1.9.2-linux-i686.tar.bz2
sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-i686/bin/phantomjs /usr/local/share/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-i686/bin/phantomjs /usr/local/bin/phantomjs
sudo ln -s /usr/local/share/phantomjs-1.9.2-linux-i686/bin/phantomjs /usr/bin/phantomjs
Installation and Calling Phantomjs
Follow the steps doesn't work, but cloned from others built. (ver2.0)
Bellow the installation procedure by Julio Napurí https://gist.github.com/julionc
Version: 1.9.8
Platform: x86_64
First, install or update to the latest system software.
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
Install these packages needed by PhantomJS to work correctly.
sudo apt-get install libfreetype6 libfreetype6-dev
sudo apt-get install libfontconfig1 libfontconfig1-dev
Get it from the PhantomJS website.
cd ~
export PHANTOM_JS="phantomjs-1.9.8-linux-x86_64"
wget https://bitbucket.org/ariya/phantomjs/downloads/$PHANTOM_JS.tar.bz2
sudo tar xvjf $PHANTOM_JS.tar.bz2
Once downloaded, move Phantomjs folder to /usr/local/share/ and create a symlink:
sudo mv $PHANTOM_JS /usr/local/share
sudo ln -sf /usr/local/share/$PHANTOM_JS/bin/phantomjs /usr/local/bin
Now, It should have PhantomJS properly on your system.
phantomjs --version
I have found this simpler way - Phantom dependencies + Npm
sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
sudo apt-get install libfreetype6 libfreetype6-dev
sudo apt-get install libfontconfig1 libfontconfig1-dev
and npm
[sudo] npm install -g phantomjs
Done.
On linux to run hello.js don't forget to add the path of hello.js:
phantomjs YourPathToPhantomjsFolder/examples/hello.js
If you want to use phantomjs easily, you can use it at phantomjscloud.com
You can get the result just by http request.
This is how I place a specific version of phantomjs in /usr/local/bin on my docker containers.
curl -Ls https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2 \
| tar jxvf - --strip-components=2 -C /usr/local/bin/ ./phantomjs-1.9.8-linux-x86_64/bin/phantomjs
or with out ./ depending on OS.
curl -Ls https://github.com/Medium/phantomjs/releases/download/v1.9.19/phantomjs-1.9.8-linux-x86_64.tar.bz2 \
| tar jxvf - --strip-components=2 -C /usr/local/bin/ phantomjs-1.9.8-linux-x86_64/bin/phantomjs
You can get up and running without sudo or npm. Simply download, extract, and add to path.
This has the added advantage of easy backup if you are in the habit of backing up your entire home folder which I highly recommend. This also works with any version of Linux.
➤ cd ~
➤ wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
➤ mkdir phantomjs
➤ tar xjf phantomjs-2.1.1-linux-x86_64.tar.bz2 -C phantomjs
➤ echo 'export PATH="$PATH:$HOME/phantomjs/bin"' >> .profile
➤ source .profile
➤ phantomjs -v
2.1.1
The disadvantages are:
You will need to manually upgrade
Other users will not have access to this.
You could use a very simple shell script for installing/upgrading
#!/bin/sh
# install_phantomjs.sh $VERSION
$VERSION = $1
printf "Downloading PhantomJS $VERSION...\n"
wget "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$VERSION-linux-x86_64.tar.bz2"
printf "Extracting PhantomJS $VERSION to ~/phantomjs...\n"
mkdir ~/phantomjs
tar xjf phantomjs-$VERSION-linux-x86_64.tar.bz2 -C ~/phantomjs
printf "Done! Make sure $HOME/phantomjs/bin is in your path.\n"
Or in a Dockerfile
# Download and setup PhantomJS
ENV PHANTOMJS_VERSION 2.1.1
RUN curl -fSL "https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-$PHANTOMJS_VERSION-linux-x86_64.tar.bz2" -o /tmp/phantomjs.tar.bz2 && \
mkdir ~/phantomjs && \
tar xjf /tmp/phantomjs.tar.bz2 -C ~/phantomjs && \
rm /tmp/phantomjs.tar.bz2
ENV PATH /home/$USERNAME/phantomjs/bin:$PATH
Here is what I did
on my ubuntu 16.04 machine
sudo apt-get update
sudo wget https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-2.1.1-linux-x86_64.tar.bz2
sudo mv path/where/you/downloaded/phantomjs /usr/bin
and finally when I do
phantomjs -v
I get 2.1.1
After going through every answer of this thread. I think this is the best solution for installing and running phantomjs in ubuntu.

Resources