Leong's blog Leong's blog
首页
  • 编程
  • 资源
  • Golang
  • 微服务
  • vue
  • 操作系统
  • 数据结构与算法
  • Linux
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)

Leong Y

跑起来吧
首页
  • 编程
  • 资源
  • Golang
  • 微服务
  • vue
  • 操作系统
  • 数据结构与算法
  • Linux
关于
  • 分类
  • 标签
  • 归档
GitHub (opens new window)
  • nodejs环境安装

    • 安装nodejs本体
      • CentOS7安装步骤
      • 卸载旧的nodejs
      • 添加Node.js Yum存储库
      • 在CentOS上安装Node.js.
      • Ubuntu安装步骤
      • 直接一步到位用apt包管理安装
    • 安装n模块管理nodejs
      • 额外需要
        • yarn的安装
    leong
    2022-08-15
    随笔
    目录

    nodejs环境安装

    # Linux安装Nodejs环境

    # 安装nodejs本体

    # CentOS7安装步骤

    # 卸载旧的nodejs

    yum remove nodejs
    
    1

    # 添加Node.js Yum存储库

    $ yum clean all && yum makecache fast
    $ yum install -y gcc-c++ make
    $ curl -sL https://rpm.nodesource.com/setup_16.x | sudo -E bash -
    
    1
    2
    3
    • 可以按个人需求选择版本,这里我选择16.x

    # 在CentOS上安装Node.js.

      yum install nodejs
    
    1

    # Ubuntu安装步骤

    # 直接一步到位用apt包管理安装

    sudo apt install nodejs-legacy
    sudo apt install npm
    
    1
    2

    # 安装n模块管理nodejs

    1. 用apt工具安装
    sudo npm install -g n
    
    1
    1. 使用n模块切换nodejs版本
    sudo n [版本号]
    
    sudo n latest //最新版本
    sudo n stable //稳定版本
    sudo n lts //长期支持版本
    
    1
    2
    3
    4
    5

    # 额外需要

    一般来说到这里,nodejs的安装需求就已经解决了百分之90了,但如果你还需要装如yarn,pnpm等工具,可参考本小节

    # yarn的安装

    npm install -g yarn
    
    1
    上次更新: 2024/06/03, 10:31:32
    最近更新
    01
    vue3快速上手
    07-31
    02
    程序从加载到运行的过程
    07-08
    03
    进程、线程、协程
    07-08
    更多文章>
    Theme by Vdoing | Copyright © 2023-2024 Leong Y | MIT License
    • 跟随系统
    • 浅色模式
    • 深色模式
    • 阅读模式