我正在安装sylius bundle,同时安装sylius,我需要运行纱线安装 当我运行命令时:
yarn install
我得到了错误:
ERROR: [Errno 2] No such file or directory: 'install'
我正在安装sylius bundle,同时安装sylius,我需要运行纱线安装 当我运行命令时:
yarn install
我得到了错误:
ERROR: [Errno 2] No such file or directory: 'install'
当前回答
在你的终端上复制并粘贴这段代码 这对我来说非常有效。
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
其他回答
yarn包(目前是cmdtest包的别名)的名称冲突。你要找的包装是yarnpkg。所以,试试这个命令:
sudo apt-get remove cmdtest
sudo apt-get install yarnpkg
不幸的是,在yarnpkg中,命令纱被命名为yarnpkg。你可能想要创建一个别名:
sudo ln -s /usr/bin/yarnpkg /usr/local/bin/yarn
这对我很有效
sudo yarn install
使用Ubuntu 22.04 我在新安装Ubuntu时遇到了这个问题。对我有效的解决方法是:
sudo apt remove cmdtest
sudo apt-get remove yarn && sudo apt-get purge yarn
sudo apt update
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 install yarn
yarn --version # 1.22.19
(编辑:我后来尝试了这个方法,最初并没有奏效。但是当我重新启动电脑再试一次时,它还是工作了。想想看…)
为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
sudo npm install -g yarnpkg
npm WARN deprecated yarnpkg@0.15.1: Please use the `yarn` package instead of `yarnpkg`
这对我来说是可行的
sudo npm install -g yarn