zoukankan      html  css  js  c++  java
  • Node——服务器上安装Node.js

     服务器版本

    [root@izuf63g0jydq42k49eo7zcz ~]# uname -a
    Linux izuf63g0jydq42k49eo7zcz 3.10.0-693.2.2.el7.x86_64 #1 SMP Tue Sep 12 22:26:13 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
    [root@izuf63g0jydq42k49eo7zcz ~]# lsb_release -a
    LSB Version:    :core-4.1-amd64:core-4.1-noarch
    Distributor ID: CentOS
    Description:    CentOS Linux release 7.4.1708 (Core) 
    Release:        7.4.1708
    Codename:       Core
    [root@izuf63g0jydq42k49eo7zcz ~]# cat /proc/version
    Linux version 3.10.0-693.2.2.el7.x86_64 (builder@kbuilder.dev.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-16) (GCC) ) #1 SMP Tue Sep 12 22:26:13 UTC 2017
    [root@izuf63g0jydq42k49eo7zcz ~]# 

     安装脚本

    #!/bin/bash
    
    #准备
    
    yum install -y wget
    
    #下载安装
    
    wget https://nodejs.org/dist/v10.15.3/node-v10.15.3-linux-x64.tar.xz
    
    mkdir -p /usr/local/nodejs
    
    tar -Jxvf node-v10.15.3-linux-x64.tar.xz -C /usr/local/nodejs/
    
    #写入环境变量
    
    echo "export PATH=/usr/local/nodejs/node-v10.15.3-linux-x64/bin:$PATH" >> /etc/profile
    
    source /etc/profile
    
    #查看版本信息
    
    node -v
    
    npm version
    
    npx -v

    修改权限

    chmod +x node-install.sh 

    执行脚本

    sh node-install.sh
  • 相关阅读:
    salt执行报错一例
    state配置语言实战
    salt-ssh使用
    八、job管理
    六、saltstack的module组件
    五、Pillar数据管理中心
    Web Server与App Server
    二分查找的时间复杂度(TODO )
    二分查找的时间复杂度(TODO )
    git : error setting certificate verify locations
  • 原文地址:https://www.cnblogs.com/wangyang0210/p/10644057.html
Copyright © 2011-2022 走看看