LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-27-2016, 01:01 PM   #1
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Rep: Reputation: Disabled
Installing different versions of nodejs


Per https://nodejs.org/en/download/packa...nux-and-fedora, I am trying to install nodejs version 6 and npm on Centos6.

When I check the version of the installed package, it appears that it is some old version 0.10.46. But if I google "0.10.46-1.el6 nodejs", it appears not to be that old.

What version of nodejs have I installed? If old, how do I install a newer version?

Thanks


Code:
[root@devserver ~]# curl --silent --location https://rpm.nodesource.com/setup_6.x | bash -

## Installing the NodeSource Node.js 6.x repo...


## Inspecting system...

+ rpm -q --whatprovides redhat-release || rpm -q --whatprovides centos-release || rpm -q --whatprovides cloudlinux-release || rpm -q --whatprovides sl-release
+ uname -m

## Confirming "el6-x86_64" is supported...

+ curl -sLf -o /dev/null 'https://rpm.nodesource.com/pub_6.x/el/6/x86_64/nodesource-release-el6-1.noarch.rpm'

## Downloading release setup RPM...

+ mktemp
+ curl -sL -o '/tmp/tmp.ZO59oc8RTf' 'https://rpm.nodesource.com/pub_6.x/el/6/x86_64/nodesource-release-el6-1.noarch.rpm'

## Installing release setup RPM...

+ rpm -i --nosignature --force '/tmp/tmp.ZO59oc8RTf'

## Cleaning up...

+ rm -f '/tmp/tmp.ZO59oc8RTf'

## Checking for existing installations...

+ rpm -qa 'node|npm' | grep -v nodesource

## Run `yum install -y nodejs` (as root) to install Node.js 6.x and npm.
## You may also need development tools to build native addons:
##   `yum install -y gcc-c++ make`

[root@devserver ~]# yum install -y nodejs npm
Loaded plugins: fastestmirror, priorities, security
Setting up Install Process
Loading mirror speeds from cached hostfile
 * base: mirror.tocici.com
 * epel: linux.mirrors.es.net
 * extras: mirror.pac-12.org
 * ius: mirrors.kernel.org
 * updates: centos.mirror.ndchost.com
183 packages excluded due to repository priority protections

......                                                                                                                                                                                      75/75

Installed:
  nodejs.x86_64 0:0.10.46-1.el6                                                                                           npm.noarch 0:1.3.6-5.el6

Dependency Installed:
.....

Complete!
[root@devserver ~]#

[root@devserver ~]# node -v
v0.10.46
[root@devserver ~]# npm -v
1.3.6
[root@devserver ~]#
 
Old 11-27-2016, 01:35 PM   #2
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,970
Blog Entries: 4

Rep: Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027Reputation: 4027
Although a package might install one particular version of this JavaScript library (and might uninstall older ones from its appointed location for such things), bear in mind that this library will be used by clients of web sites hosted by this machine ... each client requesting the library from the server through some URL.

And so, there's nothing in this world keeping you from downloading other versions of this library, directly from its authoritative source, and placing these different versions where this-or-that web site will know to find it. (Probably abstracting those locations to the client through the use of Apache <Directory> or <Location> tags.)

Also consider carefully how you choose to specify the caching behavior of this (rather large, even when minified) library file. You want to encourage the client browser to cache it, without losing the ability to supersede their cached copy.

Note that it is not recommended to attempt to source the library directly from nodejs.org, nor from any other "external" source. You should have copies on the server machine of "anything and everything which this server will be tasked to deliver to a client."

- - -
Incidentally: this reply applies equally to any host operating system, and/or any web-server software.

Last edited by sundialsvcs; 11-27-2016 at 01:38 PM.
 
Old 11-27-2016, 01:53 PM   #3
NotionCommotion
Member
 
Registered: Aug 2012
Posts: 789

Original Poster
Rep: Reputation: Disabled
Hi sundialsvcs,

Node.js is a little (make that a lot) different than tradition JavaScript. Particularly, it is executed by the server and not the web browser client, and it is not a single file called Node.js, but that is the name of the entire environment.

Thanks
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Installing nodejs and npm on Centos NotionCommotion Linux - Newbie 1 11-28-2016 08:59 PM
nodejs on debian fmc-uws Linux - Software 5 12-04-2014 05:19 AM
[SOLVED] nodejs installation error yashfire007 Linux - Newbie 4 05-15-2013 10:37 AM
[SOLVED] nodejs, nodejs-dev incompatibility in Ubintu? mjbradakis Linux - Software 1 03-25-2013 12:50 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:20 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration