0
点赞
收藏
分享

微信扫一扫

【六祎 MAC】2022年最新版本MAC M1安装node



1.安装nvm

 ~/ git clone https://gitee.com/mirrors/nvm.git
Cloning into 'nvm'...
remote: Enumerating objects: 8854, done.
remote: Counting objects: 100% (136/136), done.
remote: Compressing objects: 100% (128/128), done.
remote: Total 8854 (delta 66), reused 0 (delta 0), pack-reused 8718
Receiving objects: 100% (8854/8854), 2.66 MiB | 1.04 MiB/s, done.
Resolving deltas: 100% (5729/5729), done.


2.重命名 .nvm

 ~/ mv nvm .nvm


3.编辑 .zshrc文件,加入该文件

 ~/ vim .zshrc


export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm


4.source .zshrc生效

 ~/ sourcer .zshrc


5.查看安装版本

 ~/ nvm -v
0.39.2


6.查看node版本

 ~/ nvm list-remote

【六祎 MAC】2022年最新版本MAC M1安装node_node.js


7.安装node

 ~/ nvm install v12.22.12
Downloading and installing node v12.22.12...
Downloading https://nodejs.org/dist/v12.22.12/node-v12.22.12-darwin-x64.tar.xz...
########################################################################################################## 100.0%
Computing checksum with shasum -a 256
Checksums matched!
Now using node v12.22.12 (npm v6.14.16)
Creating default alias: default -> v12.22.12


8.查看版本

 ~/ node -v
v12.22.12
 ~/ npm -v
6.14.16


举报

相关推荐

0 条评论