nvm with yarn Yarn requires Node.js 4.0 or higher to be installed

纵然是瞬间 提交于 2020-01-23 12:04:12

问题


I have 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)

I installed yarn with:

sudo apt-get install --no-install-recommends yarn

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.

How can I fix it?


回答1:


This gist helped on this problem.

Run the following commands

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

And add the following in ~/.bashrc

export PATH="$HOME/.yarn/bin:$HOME/.config/yarn/global/node_modules/.bin:$PATH"

It should then work properly without the warning after restarting the shell.



来源:https://stackoverflow.com/questions/53266097/nvm-with-yarn-yarn-requires-node-js-4-0-or-higher-to-be-installed

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!