我正在安装sylius bundle,同时安装sylius,我需要运行纱线安装 当我运行命令时:

yarn install

我得到了错误:

ERROR: [Errno 2] No such file or directory: 'install'

当前回答

尝试以上步骤,在Ubuntu 20上无效。 对于Ubuntu 20,像上面建议的那样删除cmdtest和yarn。使用以下命令安装纱线:

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 update && sudo apt install yarn

其他回答

在你的终端上复制并粘贴这段代码 这对我来说非常有效。

sudo apt remove cmdtest
sudo apt remove yarn
curl -sS 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 -y

为Ubuntu 16.04安装Yarn(不确定这是否会与14.04相同,因为它与zappee对17.04的回答略有不同)

curl -sS 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
curl -sL https://deb.nodesource.com/setup_9.x | sudo -E bash -
apt-get update
apt-get install nodejs
apt-get install yarn

然后从你安装sylius项目的地方(/var/www/mysite)

yarn install
yarn run gulp

对于Ubuntu 18.04.4 LTS,我只是遵循官方说明: https://classic.yarnpkg.com/en/docs/install#debian-stable

curl -sS 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 update && sudo apt install yarn

不需要做:

sudo apt remove cmdtest

这只在Ubuntu 17.04上是必需的。我想。

我希望这能有所帮助!

我的解决方案是

curl -sS 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

也有此问题(windows),修复是完全关闭所有终端实例,然后重试。