PeaceSheep's blog PeaceSheep's blog
首页
  • 分类
  • 标签
  • 归档
相关链接
提建议&咨询&赞赏
GitHub (opens new window)

PeaceSheep

以最简洁、易懂的话解决问题
首页
  • 分类
  • 标签
  • 归档
相关链接
提建议&咨询&赞赏
GitHub (opens new window)
  • 01 说明
  • 环境安装与配置

    • ubuntu换源
    • centos安装配置docker
    • k8s介绍及安装教程
    • github actions自动部署前端项目
    • 服务器创建git仓库,部署自己的博客
    • 使用python批量管理linux设备
    • 关于如何使用机房电脑批量烧录U盘的奇思妙想
    • 自建Zerotier节点
    • ubuntu安装g++
    • conda从古老版本升级
    • openkylin国产麒麟操作系统安装zerotier
    • nodejs、yarn安装
      • Windows
        • 1. 安装nodejs:
        • 2. 配置nodejs相关路径
        • 3. yarn安装
        • 4. 配置yarn相关路径
      • Linux
        • 1. 安装nodejs:
        • 2. 配置nodejs相关路径
  • 常用命令与配置文件

  • 常用代码

  • 常用操作
  • 环境安装与配置
PeaceSheep
2024-06-03
目录

nodejs、yarn安装

# Windows

# 1. 安装nodejs:

从nodejs官网 (opens new window) 下载安装包安装。

# 2. 配置nodejs相关路径

npm config set prefix "D:\nodejs\node_global"
npm config set cache "D:\nodejs\node_cache"

1
2
3

然后将D:\nodejs\node_global添加到PATH环境变量。

# 3. yarn安装

npm install -g yarn@latest
1

# 4. 配置yarn相关路径

yarn config set prefix "D:\nodejs\yarn-data"
yarn config set global-folder "D:\nodejs\yarn-global"
yarn config set cache-folder "D:\nodejs\yarn-cache"
yarn config set link-folder "D:\nodejs\yarn-link"

1
2
3
4
5

# Linux

# 1. 安装nodejs:

注意

不要使用apt安装,版本太老!

到nodejs官网 (opens new window)直接看安装命令,比如使用fnm和22版本的node,命令如下:

curl -fsSL https://fnm.vercel.app/install | bash
fnm use --install-if-missing 22 # 版本根据需要修改
1
2

如果第一行命令提示Could not infer shell type. Please set up manually.,可以先下载那个文件,然后手动编辑sh文件里面的setup_shell函数,直接保留你想要的那个shell的命令就可以。

# 2. 配置nodejs相关路径

npm config set prefix "~/nodejs/node_global"
npm config set cache "~/nodejs/node_cache"
1
2
编辑 (opens new window)
上次更新: 2025/04/15, 10:52:45
openkylin国产麒麟操作系统安装zerotier
Nginx多种配置样例,HTTPS配置与HTTP自动重定向

← openkylin国产麒麟操作系统安装zerotier Nginx多种配置样例,HTTPS配置与HTTP自动重定向→

最近更新
01
ubuntu安装g++显示已有但是输入g++又找不到命令
04-15
02
使用cloudflare-r2搭建webdav
04-08
03
LLM聚合平台客户端对比
03-29
更多文章>
Theme by Vdoing | Copyright © 2022-2025 PeaceSheep
冀ICP备2022004632号-1
  • 跟随系统
  • 浅色模式
  • 深色模式
  • 阅读模式