I installed the NodeJS in Ubuntu 14.04 by nvm
by following this site Installing NodeJS
Though I had the following problem as
nvm ls
sbin
mkdir: cannot create directory ‘/usr/sbin/alias’: Permission denied
Then I found to resolve this as (from NVM solution)
$ export NVM_DIR=~/.nvm
$ echo $NVM_DIR
/home/roy/.nvm
Then It works fine.
Now the problem, I face is that if I restart or even open a new console, I can't find the node
again.
roy@Croy:~$ node -version
The program 'node' can be found in the following packages:
* node
* nodejs-legacy
Try: sudo apt-get install <selected package>
I have to follow those steps,
I do nvm install 0.11.13
then it shows
v0.11.13 is already installed.
Now using node v0.11.13
Here is my Stackoverflow question - the following answer is not working.
How to come out from here ?
As seen here
Run command:
and in my case it displayed
/usr/sbin/node
.If it says command not found, skip to 3. Remove it by
Run command:
In my case it displayed
/usr/bin/nodejs
Make a link
OR
Run command:
For more information: See here.
As seen here
Node has a different name in the current version, mine is
v0.10.25
.The current
node
is justnodejs
.To use the old commands you have to create a symbolic link like this.
and that's it.
Run:
node --version
The following line adds node to your
$PATH
:Use your installed node version.
How about using the official instructions from the nodejs site:
For v6:
For v4:
I've tested these from Windows bash (via subsystem for Linux - 14.04) and it had the correct
node
alias. Runningsudo apt-get install -y nodejs
without first running the setup script will result in you getting node 0.10.This is an old post. But I stumbled upon this when I faced the same problem with NPM on WSL2.
I had to create a bash alias to point to the npm that I installed on ubuntu wsl.