nodejs vs node on ubuntu 12.04
You need to manually create a symlink /usr/bin/node
. Shortcut for bash compatible shells:
sudo ln -s `which nodejs` /usr/bin/node
Or if you use non-standard shells, just hardcode the path you find with which nodejs
:
sudo ln -s /usr/bin/nodejs /usr/bin/node
Later edit
I found this explanation in the link you posted
There is a naming conflict with the node package (Amateur Packet Radio Node Program), and the nodejs binary has been renamed from node to nodejs. You'll need to symlink /usr/bin/node to /usr/bin/nodejs or you could uninstall the Amateur Packet Radio Node Program to avoid that conflict.
Later later edit
It's been a while since I answered this. Although the solution I posted up here worked for me several times, users have reported a few more solutions within the comments:
From @user229115
sudo update-alternatives --install /usr/bin/node node /usr/bin/nodejs 10
From AskUbuntu (user leftium)
sudo apt-get --purge remove node
sudo apt-get --purge remove nodejs
sudo apt-get install nodejs
Setting up node.js on Ubuntu 12.04 (with eclipse/nodeclipse/enide)
Ok figured it out. I had to set up the node.js path in Eclipse under Preferences>Nodeclipse.
Install latest nodejs version in ubuntu 14.04
sudo apt-get install curl
For Node.js v4
curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
sudo apt-get install -y nodejs
For Node.js v5:
curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
sudo apt-get install -y nodejs
Node.js v6:
curl -sL https://deb.nodesource.com/setup_6.x | sudo -E bash -
sudo apt-get install -y nodejs
Node.js v7:
curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
sudo apt-get install -y nodejs
Node.js 8:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
https://nodejs.org/en/download/package-manager/
Node forever doesn't work on Ubuntu 12.04.1
'sudo npm update -g forever' doesn't work for me. I deleted all the installed modules and install it again. The forever works. The steps are as below.
Delete the all the existing forever modules.
$ sudo rm -R /usr/lib/node_modules/forever
$ sudo rm -R /usr/local/lib/node_modules/forever
Install the forever again.
$ sudo npm install forever -g
Nodejs and Coffeescript install (Ubuntu 12.04)
All sorted now. I had to delete all the exiting folders as well as everything from the ubuntu repositories containing the npm, coffee-script and node and install everything from git.
Step by step installation:
1. clone https://github.com/joyent/node.git
2. git checkout v0.6.17 //current stable at my time
3. cd node && ./configure && make && make install
4. curl http://npmjs.org/install.sh | sudo sh
5. download coffeescript from git and do sudo bin/cake install
6. sudo npm install coffee-script -g
This should work
installing nodejs on ubuntu 12.10
Maybe try this?
sudo apt-get install g++
Installed node.js ver 0.8 but node --version still shows previous version 0.6.12
The problem is, you need to replace the new location for node with the old in your PATH variable. If you have an old manual install, find the old path to node by running echo $PATH
. Then run this command:
export PATH=${PATH%$OLD_NODE_PATH/bin*}$NEW_NODE_PATH/bin${PATH#$*OLD_NODE_PATH/bin}
Or if you are using an install from the apt-get repository, just run:
export PATH=$NEW_NODE_PATH/bin
And that should fix your problem. But there is a better way! The best tool to manage your node.js environment is NVM. It exactly like RVM for ruby and similar to virtualenv for python, if you are familiar with those tools. It allows you to switch versions of node and download new ones extremely efficiently, and is easy to use. Download and install with:
curl https://raw.github.com/creationix/nvm/master/install.sh | sh
Then add this line to your bash (assuming you are running a bash shell) where it will be loaded (I prefer .bash_login for the personal stuff although it is not loaded by default):
[[ -s $HOME/.nvm/nvm.sh ]] && . $HOME/.nvm/nvm.sh
Source your bash script or restart the terminal then enter this command:
nvm install 0.8.0 && nvm use 0.8.0
This should set you up just fine. Although not necessary, you should probably get rid of all the other node installs, for the sake of tidiness. Check out their github page but to get you started here is a quick overview:
nvm ls # list all installed versions of node
nvm ls-remote # list all available versions of node
nvm install 0.9.8 # download and install node v0.9.8
nvm use 0.8.0 # switch current environment to use node v0.8.0
nvm alias default 0.8.0 # set 0.8.0 as default, you can use 'nvm use default'
nvm deactivate # use system install of node
nvm run default app.js # run app.js with default node version
Related Topics
What Does (Function($) {})(Jquery); Mean
Javascript/Jquery: $(Window).Resize How to Fire After the Resize Is Completed
Callback After All Asynchronous Foreach Callbacks Are Completed
Access Control Request Headers, Is Added to Header in Ajax Request with Jquery
Convert Utc Epoch to Local Date
How to Create a Dynamic Key to Be Added to a JavaScript Object Variable
How to Iterate Through Table Rows and Cells in JavaScript
Cross Origin Requests Are Only Supported for Http But It's Not Cross-Domain
Finding All Combinations (Cartesian Product) of JavaScript Array Values
Jquery Xml Error ' No 'Access-Control-Allow-Origin' Header Is Present on the Requested Resource.'
What Does "Options = Options || {}" Mean in JavaScript
When You Pass 'This' as an Argument
Is Safari on iOS 6 Caching $.Ajax Results
JavaScript - Href VS Onclick for Callback Function on Hyperlink