【发布时间】:2017-09-14 10:52:27
【问题描述】:
尝试使用 yarn 安装包,但我收到错误消息说我需要 nodejs,但安装 nodejs 会删除纱线。同样,当我安装纱线时,nodejs 被删除。我错过了什么?
$ yarn install some-package
Yarn requires Node.js 4.0 or higher to be installed.
$ curl -sL https://deb.nodesource.com/setup_7.x | sudo -E bash -
...
...
$ sudo apt-get install -y nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gyp libc-ares-dev libjs-node-uuid libv8-3.14-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
yarn
The following NEW packages will be installed:
nodejs
...
$ sudo apt-get install yarn
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gyp libc-ares-dev libjs-node-uuid libv8-3.14-dev
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
nodejs
The following NEW packages will be installed:
yarn
...
【问题讨论】: