安装yarn实况

【**前情提要**】最近在gayhub上面得到一个开源项目,遂准备研究一下源码,当然第一步就是要把项目运行起来。然后看了一下技术栈,发现包管理工具是使用yarn,以前也听说过yarn但是也没有具体使用过,只知道是facebook发布的包管理程序。

# 壹、安装

1.下载node.js,使用npm安装
```xml
npm install -g yarn
查看版本:yarn --version
```

2.安装node.js,下载yarn的安装程序:

[ 提供一个.msi文件,在运行时将引导您在Windows上安装Yarn](https://yarnpkg.com/en/docs/install#windows-stable)

3.Yarn 淘宝源安装,分别复制粘贴以下代码行到黑窗口运行即可
```xml
yarn config set registry https://registry.npm.taobao.org -g
yarn config set sass_binary_site http://cdn.npm.taobao.org/dist/node-sass -g

```
# 贰、踩坑时刻
1.yarn使用时候报错信息:
```xml
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
```
2.检测yarn版本 yarn version
```xml
D:\Seven\ways\hadoop-2.7.3>yarn version ok
Hadoop 2.7.3
Subversion https://git-wip-us.apache.org/repos/asf/hadoop.git -r b3fe56402d908019d99af1f1f4fc65cb1d1436a2
Compiled by jdu on 2017-12-05T03:43Z
Compiled with protoc 2.5.0
From source with checksum 9ff4856d824e983fa510d3f843e3f19d
This command was run using /D:/Seven/ways/hadoop-2.7.3/share/hadoop/common/hadoop-common-2.7.3.jar
```
3.检测yarn版本 yarn --version 报错
```xml
D:\Seven\ways\hadoop-2.7.3>yarn --version
Unrecognized option: --version
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
```
4.安装依赖包 报错
```xml
D:\Seven\ways\hadoop-2.7.3>yarn install
错误: 找不到或无法加载主类 install
```
5.最后没办法重新下载windows安装包[ 提供一个.msi文件,在运行时将引导您在Windows上安装Yarn](https://yarnpkg.com/en/docs/install#windows-stable)

安装 -> 测试 -> 报错 -> 检测原因 -> 没有配置环境变量 -> 继续报错,检测原因 -> java安装环境中有默认的yarn -> 环境变量配置在它前面

6.测试
```xml
Microsoft Windows [版本 10.0.18362.239]
(c) 2019 Microsoft Corporation。保留所有权利。

C:\Users\Chirius>yarn --version
1.17.3

C:\Users\Chirius>
```

原文地址:https://www.cnblogs.com/eelve/p/11333381.html

时间: 2024-08-30 02:19:12

安装yarn实况的相关文章

1.在cmd界面搭建react-native 环境: 可参考https://reactnative.cn/docs/0.51/getting-started.html#content   (1)npm install -g yarn react-native-cli       安装yarn命令工具和react-native命令工具,Yarn是Facebook提供的替代npm的工具,可以加速n

http://www.bubuko.com/infodetail-2599307.html 1.在cmd界面搭建react-native 环境: 可参考https://reactnative.cn/docs/0.51/getting-started.html#content (1)npm install -g yarn react-native-cli 安装yarn命令工具和react-native命令工具,Yarn是Facebook提供的替代npm的工具,可以加速node模块的下载. Reac

如何在CentOS 7上安装Yarn

Yarn是与npm兼容的JavaScript软件包管理器,可帮助自动化安装,更新,配置和删除npm软件包的过程. 它的创建是为了解决npm的一系列问题,例如通过并行化操作并减少与网络连接有关的错误来加快软件包的安装过程. 本文展示如何从Yarn RPM软件包存储库在CentOS 7系统上安装Yarn. 先决条件 在开始之前,请确保以具有sudo特权的用户身份登录. 在CentOS上安装Yarn 要在CentOS 7系统上安装Yarn,请执行以下步骤: 1.如果尚未在系统上安装Node.js,请使

centos7 安装 Yarn

1 准备工作 1.1 浏览器访问安装包下载地址: https://github.com/yarnpkg/yarn/releases/ 找到需要安装的版本,以v1.12.0为例,地址为: https://github.com/yarnpkg/yarn/releases/download/v1.12.0/yarn-v1.12.0.tar.gz 1.2 下载源码 $ mkdir -p /usr/local/yarn $ wget https://github.com/yarnpkg/yarn/rele

hadoop多机安装YARN

hadoop伪分布安装称为测试环境安装,多机分布称为生成环境安装.以下安装没有进行HA(热备)和Federation(联邦).除非是性能需要,否则没必要安装Federation,HA可以一试,涉及到Zookeeper自动切换. 准备工作 1) linux优化 ①安装虚拟机linux系统,采用1.2 中的CentOS调优所有步骤,关闭防火墙:②设置网络为桥接模式(编辑虚拟机设置->网络适配器),查看自动分配ip或手动配置ip:③等JDK安装的JAVA_HOME(见1.3.1)和HADOOP_HOM

node 中 安装 yarn

Yarn是Facebook最近发布的一款依赖包安装工具.Yarn是一个新的快速安全可信赖的可以替代NPM的依赖管理工具 快速安装 //在NPM 中安装npm install -g yarn MacOS 在Mac上安装比较方便,使用初始化脚本即可 1 curl -o- -L https://yarnpkg.com/install.sh | bash Linux Po主自己的机器是Ubuntu,安装比较简单 输入命令 1 2 sudo apt-key adv --keyserver pgp.mit.

mac 离线安装yarn

因为网络的问题,使用brew install yarn 总是失败.所以记录一下 离线安装的方法 如下图所示 ,先下载下来. 1.解压 2.配置环境变量 touch ~/.bash_profile open ~/.bash_profile export PATH="$PATH:`yarn global bin`" 推出终端 重新试一下就好了 原文地址:https://www.cnblogs.com/kangjunyun/p/12237593.html

centos7安装nodejs 和 yarn

如何从EPEL库安装Node.js 另一个有效且简单的方法来安装Node.js就是从官方库.这同样确保您可以访问到EPEL库,你可以通过运行以下命令. sudo yum install epel-release 现在可以使用yum命令安装Node.js了. sudo yum install nodejs 在 CentOS.Fedora.RHEL 上,你可以通过 RPM 包仓库安装 Yarn. sudo wget https://dl.yarnpkg.com/rpm/yarn.repo -O /e

nvm+node.js+yarn安装

安装nvm: curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.0/install.sh | bash 如果卸载的话直接将对应的文件删除即可 安装node: nvm install node # 安装默认最新版本 nvm install 6.9.1 # 安装指定版本6.9.1 安装yarn

安装使用yarn,使用国内镜像加速npm和yarn

安装yarn https://yarnpkg.com/lang/zh-hans/docs/install/ 使用国内镜像加速npm和yarn 1. npm config set registry=https://registry.npm.taobao.org 2. yarn config set registry https://registry.npm.taobao.org 3. 下载cnpm:npm install -g cnpm --registry=https://registry.np