Ric*_*ing 102 ubuntu sylius ubuntu-14.04 yarnpkg
我正在安装sylius bundle并且在安装sylius时我需要运行yarn install所以当我运行命令时
yarn install
Run Code Online (Sandbox Code Playgroud)
我收到错误:
错误:[Errno 2]没有这样的文件或目录:'install'
zap*_*pee 268
我在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
Run Code Online (Sandbox Code Playgroud)
然后
~$ yarn install
Run Code Online (Sandbox Code Playgroud)
结果:
yarn install v1.3.2
warning You are using Node "6.0.0" which is not supported and may encounter bugs or unexpected behavior. Yarn supports the following semver 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.
Run Code Online (Sandbox Code Playgroud)
希望它能帮到你.
Net*_*uel 59
我在Ubuntu 18.04上遇到了同样的问题.这对我有用:
我删除cmdtest
和yarn
sudo apt remove cmdtest
sudo apt remove yarn
Run Code Online (Sandbox Code Playgroud)
使用npm全局安装纱线
sudo npm install -g yarn
Run Code Online (Sandbox Code Playgroud)
Vik*_*dav 44
尝试删除现有纱线(这是*nix系统的传统黑匣子命令行工具的模块.
sudo apt remove cmdtest sudo apt remove yarn
通过npm安装简单
npm install -g yarn
现在安装了纱线.运行你的命令.
sudo npm install -g yarn
我希望这会奏效.干杯!
Gus*_*uss 31
感谢所有正确建议删除 Ubuntuyarn
软件包并通过 NPM 安装 Yarn 的答案,这里有一个详细的解释和解释(并且,请注意,意见):
No such file or directory
出现错误的原因yarn install
是您没有使用“正确”的 Yarn:yarn
使用 Ubuntu 软件源安装时获得的软件是cmdtest blackbox testing suite 中的“yarn”场景测试工具。这可能不是你的意思,因为 Yarn 也是一个流行的 Javascript 应用程序开发生命周期工具(类似于 Make、Maven 和朋友)。
Javascript Yarn 工具在 Ubuntu 软件源中不可用,但可以通过 NPM 安装(这是 Yarn 旨在取代的另一个开发生命周期工具 - 所以这很尴尬......)。
要使 Yarn 在 Ubuntu 中可用,首先要删除cmdtest
它及其工具:
$ sudo apt purge cmdtest
Run Code Online (Sandbox Code Playgroud)
然后确保安装了 NPM:
$ sudo apt install npm
Run Code Online (Sandbox Code Playgroud)
然后使用 NPM 安装 Yarn:
$ npm install -g yarn
Run Code Online (Sandbox Code Playgroud)
注意: usingnpm install -g
将为您当前的用户帐户安装一个 Javascript 包,这对于大多数用途应该没问题。如果你想为所有用户安装 Yarn,你可以使用sudo
NPM 命令,但不推荐这样做:在多用户操作系统的上下文中,NPM 包很少被审计以确保安全,安装一些包甚至可能会在安装时中断他们作为“根”。NPM 曾经警告不要运行它,sudo
而今天不这样做的主要原因是它会惹恼那些使用沙盒“类根”环境(例如 Docker)为单用户服务器构建和部署 Javascript 应用程序的人。
Omi*_*aha 27
sudo apt-get purge cmdtest
sudo apt-get purge yarn
Run Code Online (Sandbox Code Playgroud)
建议通过 npm 包管理器安装 Yarn,当您在系统上安装 Node.js 时,它会与 Node.js 捆绑在一起。
安装 npm 后,您可以运行以下命令来安装和升级 Yarn:
npm install --global yarn
Run Code Online (Sandbox Code Playgroud)
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
Run Code Online (Sandbox Code Playgroud)
sudo apt update && sudo apt install yarn
Run Code Online (Sandbox Code Playgroud)
小智 24
以下步骤适用于 Pop!_OS 20.10 & ubuntu 20.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
yarn install
Jim*_*ode 16
使用 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
Run Code Online (Sandbox Code Playgroud)
yarn --version # 1.22.19
Run Code Online (Sandbox Code Playgroud)
(编辑:我随后尝试过此操作,但最初不起作用。但是当我重新启动计算机并再次尝试时,它确实起作用了。找出其中一个......)
Jér*_*ler 11
包存在名称冲突yarn
(当前是包的别名cmdtest
)。您正在寻找的包是yarnpkg
. 所以,尝试这个命令:
sudo apt-get remove cmdtest
sudo apt-get install yarnpkg
Run Code Online (Sandbox Code Playgroud)
不幸的是,对于yarnpkg
,命令yarn
被命名为yarnpkg
。您可能想创建一个别名:
sudo ln -s /usr/bin/yarnpkg /usr/local/bin/yarn
Run Code Online (Sandbox Code Playgroud)
fr0*_*r0x 10
为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
Run Code Online (Sandbox Code Playgroud)
然后从你安装sylius项目的任何地方(/ var/www/mysite)
yarn install
yarn run gulp
Run Code Online (Sandbox Code Playgroud)
对于 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
Run Code Online (Sandbox Code Playgroud)
不需要做:
sudo apt remove cmdtest
Run Code Online (Sandbox Code Playgroud)
这仅在 Ubuntu 17.04 上是必需的。* 我认为。
我希望它有帮助!
尝试了上述步骤,在 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
Run Code Online (Sandbox Code Playgroud)
TLDR; 对于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
Run Code Online (Sandbox Code Playgroud)
查看此官方文档/指南,以在Ubuntu(所有版本的Ubuntu OS)上安装yarn并注意其他
cmdtest
错误。https://yarnpkg.com/lang/zh-CN/docs/install/#debian-stable
归档时间: |
|
查看次数: |
62346 次 |
最近记录: |