Linux nodejs binary installation environment variable configuration

Official website to download the corresponding binary package system (the Binaries)

Unzip to the directory you want to install

 

vi / etc / profile

Add at the end of file

export NODE_HOME=/nodejs路径
export PATH=$PATH:$NODE_HOME/bin 
export NODE_PATH=$NODE_HOME/lib/node_modules


Save and exit

source /etc/profile

 

verification

node -v print out nodejs version

npm -v npm version

 

 

Guess you like

Origin www.cnblogs.com/dch0/p/11895801.html