gpt4 book ai didi

node.js - yarn 依赖,nodejs,在安装 yarn 期间被删除,反之亦然?

转载 作者:IT老高 更新时间:2023-10-28 23:24:29 27 4
gpt4 key购买 nike

尝试使用 yarn 安装包,但我收到错误消息说我需要 nodejs,但安装 nodejs 会删除 yarn 。同样,当我安装 yarn 时,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
...

最佳答案

我在尝试在 WSL 上安装 Yarn 和 NodeJS 时遇到了这个问题。以下是我为使其工作而采取的步骤:

apt-get remove node
apt-get remove yarn

curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs

curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update && sudo apt-get install yarn

关于node.js - yarn 依赖,nodejs,在安装 yarn 期间被删除,反之亦然?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43474890/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com