—— 阿尔伯特·爱因斯坦

程序员の奇妙冒险

安装软件MacOS
2025-04-08 14:51阅读:163评论:0

brew安装node

以安装node14为例 breww 安装node 使用 n 切换版本无效,去官网下载pkg 安装包没有这个问题 安装brew install node\@14 卸载brew uninstall node\@14 当执行brew install node\@14命令。下载安装完成后会提升如下 意思是想

_PROTECTED0__
breww 安装node 使用 n 切换版本无效,去官网下载pkg 安装包没有这个问题
  • 安装brew install node\@14
  • 卸载brew uninstall node\@14
  • 当执行brew install node\@14命令。下载安装完成后会提升如下
1
2
3
4
5
6
7
If you need to have node\@14 first in your PATH, run:
echo 'export PATH="/usr/local/opt/node\@14/bin:\$PATH"' >> \~/.zshrc
 
For compilers to find node\@14 you may need to set:
export LDFLAGS="-L/usr/local/opt/node\@14/lib"
export CPPFLAGS="-I/usr/local/opt/node\@14/include"
 
  • 意思是想让你配置node的环境变量,不然node的命令无法使用
_PROTECTED0__
1
2
3
4
5
$ echo 'export PATH="/usr/local/opt/node@14/bin:$PATH"' >> ~/.zshrc
$ echo 'export LDFLAGS="-L/usr/local/opt/node@14/lib"' >> ~/.zshrc
$ echo 'export CPPFLAGS="-I/usr/local/opt/node@14/include"' >> ~/.zshrc
$ source ~/.zshrc
 
_PROTECTED0_PROTECTED2_PROTECTED1__
1
2
3
4
npmyarn NPM
npm config set registry https://registry.npm.taobao.org
yarn config set registry https://registry.npm.taobao.org
 
评论(0)
暂无评论来抢沙发吧~