node configuration under linux environment

1.linux into node.js package
① Windows up and down in a good pass in the past, you can go to the official website to download the archive node directly into them
②wget back to keep the path to the download:

wget https://npm.taobao.org/mirrors/node/v10.8.0/node-v10.8.0-linux-x64.tar.gz
tar zxvf node-v10.8.0-linux-x64.tar.gz

2. Extract the archive
Here Insert Picture Description

3. Configure flexible connection (I have not found the right path), followed by the setting environment variables method
configuration software connection way: the Global node can use the command

You can use the whereis command to view the file path: whereis node


ln -s /usr/local/node/bin/node /usr/bin/node  --将node源文件映射到usr/bin下的node文件

ln -s /usr/local/node/bin/npm /usr/bin/npm

set environment variables * approach
Here Insert Picture Description
under / home etc directory to find the
editorial content after vi / etc / Profile , at the end:

export NODE_HOME=~/mysofltware/node-v9.11.0-linux-x64   
 //这里填写自己的路径~/mysofltware/node-v9.11.0-linux-x64 
export PATH=$PATH:$NODE_HOME/bin
export NODE_PATH=$NODE_HOME/lib/node_modules

4. Last Edit: source / etc / profile settings to take effect
5. Check whether the configuration: the Node -v / npm -v
(if not configured successfully, please check the path is correct, or try other methods)
Here Insert Picture Description

Published 98 original articles · won praise 4 · views 20000 +

Guess you like

Origin blog.csdn.net/weixin_42416812/article/details/100653651