Ubuntu18.10 安装Node
1.下载
从 官网https://nodejs.org/en/ 下载对应的压缩包。
这里使用的是 node-v10.13.0-linux-x64.tar.xz 。
2.解压
tar xf node-v10.13.0-linux-x64.tar.xz -C ~/apps/web/
1
3.配置系统变量
打开/etc/profile:
sudo vim /etc/profile
1
输入并保存:
#SET PATH FOR NODEJS
export NODE_HOME=/home/windcodercom/apps/web/node-v10.13.0
export PATH=$NODE_HOME/bin:$PATH
1
2
3
2
3
4.使变量生效
source /etc/profile
1
5.设置全局路径
可选项。
npm config set cache "/home/wind/apps/web/node-v10.13.0/node_cache"
npm config set prefix "/home/wind/apps/web/node-v10.13.0/node_global"
1
2
3
2
3
查看配置
npm config ls
1
2
2
预览
除特别注明外,本站所有文章均为 windcoder 原创,转载请注明出处来自: ubuntu18-10-anzhuangnode
Loading comments...

预览
暂无数据