当我尝试通过 homebrew 安装纱线时。 收到以下消息
My-MacBook-Pro:share gt$ brew install yarn
Error: You must `brew link node` before yarn can be installed
My-MacBook-Pro:share gt$
运行brew link节点导致
My-MacBook-Pro:share gt$ brew link node
Linking /usr/local/Cellar/node/7.6.0...
Error: Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
rm '/usr/local/bin/node'
To force the link and overwrite all conflicting files:
brew link --overwrite node
To list all files that would be deleted:
brew link --overwrite --dry-run node
My-MacBook-Pro:share gt$
所以我尝试了覆盖选项
My-MacBook-Pro:share gt$ brew link --overwrite node
Linking /usr/local/Cellar/node/7.6.0...
Error: Could not symlink share/doc/node/gdbinit
/usr/local/share/doc/node is not writable.
My-MacBook-Pro:share gt$
在 /usr/local/share 上执行了 chmod,然后它抱怨 /usr/local/lib/dtrace 不可写
我走的是正确的道路还是只是一个兔子洞? 安装纱线的干净方法是什么?
在 macOS 和通用 Unix 环境上安装 Yarn 最简单的方法之一是通过我们的 shell 脚本。您可以通过在终端中运行以下代码来安装 Yarn:
curl -o- -L https://yarnpkg.com/install.sh | bash