The main reason that I'm trying to install is so that I can use tern
and get completion with Emacs... but I'm getting a bit confused with some of the install parts.
Here's a prompt that I have;
┌─[dev @ m]─[~/dotfiles]─[11:16:24] └─[$]› npm install -g tern The program 'npm' is currently not installed. You can install it by typing: sudo apt-get install npm ┌─[dev @ m]─[~/dotfiles]─[11:16:49] └─[$]› node The program 'node' can be found in the following packages: * node * nodejs-legacy Try: sudo apt-get install <selected package> ┌─[dev @ m]─[~/dotfiles]─[11:20:31] └─[$]› nvm install 0.12 v0.12.7 is already installed. Now using node v0.12.7 (npm v2.11.3) ┌─[dev @ m]─[~/dotfiles]─[11:20:43] └─[$]› node > x = 7 7 > x+8 15 >
So it says that I can't use node
, then I install it using nvm
and I can use node
...hrm.
I've installed nvm
already using
install_nvm () { # i need to add installation for nvm here if [[ -d ~/.nvm ]]; then echo "directory ~/.nvm exists" else echo "installing nvm now" # nvm source code here: https://github.com/creationix/nvm mkdir ~/.nvm cd ~/.nvm git clone https://github.com/creationix/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags` source ~/.nvm/nvm.sh echo "nvm should be installed now, instaling node" nvm install 0.12 fi }
So once I have done the nvm install 0.12
I'm able to npm install -g tern
, then when I open Emacs I get completion through tern
(yay)
however
If I logout then try again, I have to redo all the
nvm install 0.12
stuff, this prompt shows me trying to see where node and tern are and not getting anything, then having them after installing using nvm
;
┌─[dev @ m]─[~]─[11:43:12] └─[$]› which tern ┌─[dev @ m]─[~]─[11:43:14] └─[$]› which node ┌─[dev @ m]─[~]─[11:43:17] └─[$]› node The program 'node' can be found in the following packages: * node * nodejs-legacy Try: sudo apt-get install <selected package> ┌─[dev @ m]─[~]─[11:43:18] └─[$]› . ./.nvm/nvm nvm-exec nvm.sh ┌─[dev @ m]─[~]─[11:43:18] └─[$]› . ./.nvm/nvm.sh ┌─[dev @ m]─[~]─[11:43:36] └─[$]› node The program 'node' can be found in the following packages: * node * nodejs-legacy Try: sudo apt-get install <selected package> ┌─[dev @ m]─[~]─[11:43:37] └─[$]› nvm install 0.12 v0.12.7 is already installed. Now using node v0.12.7 (npm v2.11.3) ┌─[dev @ m]─[~]─[11:44:41] └─[$]› which tern /home/dev/.nvm/versions/node/v0.12.7/bin/tern ┌─[dev @ m]─[~]─[11:44:48] └─[$]›
Soooo
I'm just wondering what I'm doing wrong here, I'm sure there are a few bad practices anyway (don't worry I'm not in charge of any servers ;) but I'm getting a bit confused with the way I seemingly have to install node
every time I want to use it.
Thanks!
[link][4 comments]