我正在安装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'
当前回答
我的解决方案是
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
其他回答
博士TL; //运行这些命令(在Ubuntu 17.04及以上版本上测试) curl - ss https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add - 回显"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
额外提示:查看官方文档/指南,在其他Ubuntu版本上安装yarn &注意额外的cmdtest错误。https://yarnpkg.com/lang/en/docs/install/#debian-stable
如果你没有安装curl,你可以使用sudo apt install curl安装它
在你的终端上复制并粘贴这段代码 这对我来说非常有效。
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
删除错误包:
sudo apt-get purge cmdtest
sudo apt-get purge yarn
使用npm安装(推荐方式):
建议通过npm包管理器安装Yarn,当你在你的系统上安装它时,npm包管理器与Node.js捆绑在一起。
一旦你安装了npm,你可以运行以下命令来安装和升级Yarn:
npm install --global yarn
替代方法:
Debian / Ubuntu
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
我在Ubuntu 17.04上也遇到了同样的问题。
这个解决方案对我很有效:
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
then
yarn install
结果:
yarn install v1.3.2
warning You are using Node "6.0.0" which is not supported and may encounter bugs or unexpected behaviour. Yarn supports the following server range: "^4.8.0 || ^5.7.0 || ^6.2.2 || >=8.0.0"
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
info Lockfile not saved, no dependencies.
Done in 0.20s.
注意:这个解决方案在Ubuntu 16.04, Ubuntu 17.04和Ubuntu 18.04上都能很好地工作。
尝试删除现有的cmdtest和yarn(这是*nix系统的遗留黑盒命令行工具的模块):
sudo apt remove cmdtest sudo apt remove yarn
通过npm简单安装
npm install -g yarn
OR
sudo npm install -g yarn
现在纱线已经安装好了。执行命令。
yarn install sylius
我希望这能奏效。干杯!
编辑:
请记住重新打开终端以使更改生效。