Nodejs, Npm, node. The difference in packages?

Recently worked with NodeJS ect. I installed completely different packages for different tutorials + projects. I finally finished with this configuration:

louis@louis:~$ node -v
v5.10.0
louis@louis:~$ nodejs -v
v6.2.1
louis@louis:~$ npm -v
3.8.3

Can you explain the difference between the two?

+4
source share
3 answers

Your situation

It seems that you have two different versions installed nodejs, perhaps one of them was installed from sources and one from the package manager, for example apt.


louis@louis:~$ node -v
v5.10.0

This returns the outdated version of nodejs that you installed, I recommend uninstalling it.


louis@louis:~$ nodejs -v
v6.2.1

nodejs, , , , Ubuntu nodejs .

sudo ln -s `which nodejs` /usr/bin/node

node.

nodejs vs node ubuntu 12.04


louis@louis:~$ npm -v
3.8.3

npm nodejs.

, , node nvm, /

nvm, script cURL:

curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash

Wget:

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.31.1/install.sh | bash

, v5.0.x node, :

nvm install 5.0

:

nvm use 5.0

https://github.com/creationix/nvm#install-script

+4

, ubuntu. node nodejs - , node - nodejs .

npm, , node(js).

+3

, , , node.

NodeJs PATH .bash_profile ( .bashrc .bashconfig) , node , .

NVM (Node ) node " " " nvm 6.0.0 ' , NPM , node npm, npm node_modules. NVM $PATH , :

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm

.

OP , , , OP .

+1

All Articles