nvm with yarn Yarn 需要安装 Node.js 4.0 或更高版本 [英] nvm with yarn Yarn requires Node.js 4.0 or higher to be installed
本文介绍了nvm with yarn Yarn 需要安装 Node.js 4.0 或更高版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有 nvm:
nvm ls
v8.11.3
v8.11.4
-> v11.1.0
default -> 8.11.4 (-> v8.11.4)
node -> stable (-> v11.1.0) (default)
stable -> 11.1 (-> v11.1.0) (default)
我安装了纱线:
sudo apt-get install --no-install-recommends yarn
我还在 .bashrc 中添加了 alias node=nodejs
.但是当我尝试 yarn install
我看到:
I also added in .bashrc alias node=nodejs
. But when I try yarn install
I see:
Yarn requires Node.js 4.0 or higher to be installed.
我该如何解决?
推荐答案
这个 gist 帮助了这个问题.
This gist helped on this problem.
运行以下命令
echo "==> Installing Yarn package manager"
rm -rf ~/.yarn
curl -o- -L https://yarnpkg.com/install.sh | bash
# Yarn configurations
export PATH="$HOME/.yarn/bin:$PATH"
yarn config set prefix ~/.yarn -g
并在~/.bashrc
export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"
在重新启动 shell 后,它应该可以正常工作而不会发出警告.
It should then work properly without the warning after restarting the shell.
这篇关于nvm with yarn Yarn 需要安装 Node.js 4.0 或更高版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文