Nodejs

第一步:首先安装brew

命令:

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"

最终看到如下字符打印在终端上,表明安装成功了


Screen Shot 2022-06-23 at 11.30.29 PM.png

Screen Shot 2022-06-23 at 11.36.15 PM.png
Screen Shot 2022-06-23 at 11.43.50 PM.png

第二步.安装node(node中含有npm)

命令:brew install node

安装完成


Screen Shot 2022-06-23 at 11.46.05 PM.png

切换版本:


Screen Shot 2022-06-24 at 7.07.13 AM.png

简单方式安装/升级/切换node版本的方法:n & nvm

yaochen@yaochens-MBP ~ % export N_PREFIX=/opt/homebrew/bin/node
yaochen@yaochens-MBP ~ % export PATH=$N_PREFIX/bin:$PATH
yaochen@yaochens-MBP ~ % node -v
v14.16.0
yaochen@yaochens-MBP ~ % npm -v
8.12.1. //旧版本:npm v6.14.11

Node.js now supports named imports from CommonJS modules, but what does that mean?

解决npm安装依赖缓慢的问题

你可能感兴趣的:(Nodejs)