Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

yarn install, init 失败 #2841

Open
1 task done
peixin opened this issue Dec 2, 2023 · 14 comments
Open
1 task done

yarn install, init 失败 #2841

peixin opened this issue Dec 2, 2023 · 14 comments
Labels
💤 Inactive Inactive issues

Comments

@peixin
Copy link

peixin commented Dec 2, 2023

基本信息

  • 依赖包名 及 版本: @arco-design/[email protected]
  • 浏览器版本: chrome119.0.0.0

预期结果

正常 install, init, build

复现步骤

本机 yarn 1.22.21, node 20.6.1

clone 之后

yarn install 报了很多错,类似

YN0013: │ @lerna/github-client@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
at new NodeError (node:internal/errors:405:5)
at PassThrough.onclose (node:internal/streams/end-of-stream:154:30)
at PassThrough.emit (node:events:514:28)
at emitCloseNT (node:internal/streams/destroy:132:10)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

发现用的是 yarn 版本是3.0.2, yarnrc 里 yarnPath 指定的是个本地地址 .yarn/releases/yarn-berry.cjs 而这又和 package.json 里 devDependencies 里的 "yarn": "^1.22.10" 又不一样。

根据 #47 尝试删除 yarn.lock 之后 install 问题依旧

继续尝试删除 yarnPath: .yarn/releases/yarn-berry.cjs 使用本地 yarn install 安装正常了。

然后 yarn run init 失败,报错如下

yarn run v1.22.21
$ lerna run build --stream --scope=@arco-design/{vite-plugin-arco-vue-docs,arco-vue-scripts} && lerna link && lerna run build --scope=@arco-design/arco-vue-docs-navbar && lerna run init --scope=@arco-design/web-vue
lerna notice cli v4.0.0
lerna info versioning independent
lerna notice filter including ["@arco-design/vite-plugin-arco-vue-docs","@arco-design/arco-vue-scripts"]
lerna info filter [
lerna info filter '@arco-design/vite-plugin-arco-vue-docs',
lerna info filter '@arco-design/arco-vue-scripts'
lerna info filter ]
lerna info Executing command in 2 packages: "yarn run build"
@arco-design/vite-plugin-arco-vue-docs: $ tsc
@arco-design/arco-vue-scripts: $ tsc && node copy-template.js
@arco-design/arco-vue-scripts: src/scripts/docgen/utils/parse-interface.ts(62,31): error TS2345: Argument of type '{ displayName: string; exportName: string; props: PropDescriptor[]; }' is not assignable to parameter of type 'ComponentDoc'.
@arco-design/arco-vue-scripts: Property 'tags' is missing in type '{ displayName: string; exportName: string; props: PropDescriptor[]; }' but required in type 'ComponentDoc'.
@arco-design/arco-vue-scripts: error Command failed with exit code 2.
@arco-design/arco-vue-scripts: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run build exited 2 in '@arco-design/arco-vue-scripts'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

很困惑了

@Jansschen
Copy link

+1

@uxuip
Copy link

uxuip commented Dec 8, 2023

遇到同样的问题

@longshihui
Copy link
Contributor

longshihui commented Dec 15, 2023

之前我提pr我都是将yarn设置成最新版本,然后提交时候不提交yarn的更改。
这个问题之前查过,是yarn和Nodejs版本之间有关系,最新的yarn + nodejs 18+ 不存在这个问题

或许arco-design维护者应该尝试更新一下其依赖的yarn版本

yarnpkg/berry#3597 (comment)

image

@JedediahXu
Copy link

JedediahXu commented Dec 24, 2023

基本信息

  • 依赖包名 及 版本: @arco-design/[email protected]
  • 浏览器版本: chrome119.0.0.0

预期结果

正常 install, init, build

复现步骤

本机 yarn 1.22.21, node 20.6.1

clone 之后

yarn install 报了很多错,类似

YN0013: │ @lerna/github-client@npm:4.0.0 can't be found in the cache and will be fetched from the remote registry
➤ YN0001: │ Error [ERR_STREAM_PREMATURE_CLOSE]: Premature close
at new NodeError (node:internal/errors:405:5)
at PassThrough.onclose (node:internal/streams/end-of-stream:154:30)
at PassThrough.emit (node:events:514:28)
at emitCloseNT (node:internal/streams/destroy:132:10)
at process.processTicksAndRejections (node:internal/process/task_queues:81:21)

发现用的是 yarn 版本是3.0.2, yarnrc 里 yarnPath 指定的是个本地地址 .yarn/releases/yarn-berry.cjs 而这又和 package.json 里 devDependencies 里的 "yarn": "^1.22.10" 又不一样。

根据 #47 尝试删除 yarn.lock 之后 install 问题依旧

继续尝试删除 yarnPath: .yarn/releases/yarn-berry.cjs 使用本地 yarn install 安装正常了。

然后 yarn run init 失败,报错如下

yarn run v1.22.21
$ lerna run build --stream --scope=@arco-design/{vite-plugin-arco-vue-docs,arco-vue-scripts} && lerna link && lerna run build --scope=@arco-design/arco-vue-docs-navbar && lerna run init --scope=@arco-design/web-vue
lerna notice cli v4.0.0
lerna info versioning independent
lerna notice filter including ["@arco-design/vite-plugin-arco-vue-docs","@arco-design/arco-vue-scripts"]
lerna info filter [
lerna info filter '@arco-design/vite-plugin-arco-vue-docs',
lerna info filter '@arco-design/arco-vue-scripts'
lerna info filter ]
lerna info Executing command in 2 packages: "yarn run build"
@arco-design/vite-plugin-arco-vue-docs: $ tsc
@arco-design/arco-vue-scripts: $ tsc && node copy-template.js
@arco-design/arco-vue-scripts: src/scripts/docgen/utils/parse-interface.ts(62,31): error TS2345: Argument of type '{ displayName: string; exportName: string; props: PropDescriptor[]; }' is not assignable to parameter of type 'ComponentDoc'.
@arco-design/arco-vue-scripts: Property 'tags' is missing in type '{ displayName: string; exportName: string; props: PropDescriptor[]; }' but required in type 'ComponentDoc'.
@arco-design/arco-vue-scripts: error Command failed with exit code 2.
@arco-design/arco-vue-scripts: info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
lerna ERR! yarn run build exited 2 in '@arco-design/arco-vue-scripts'
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

很困惑了

请问 这个错误,咋解决呀 lerna ERR! yarn run build exited 2 in '@arco-design/arco-vue-scripts'

@chouchouji
Copy link
Contributor

同样的问题

image

@summoon6
Copy link

summoon6 commented Jul 4, 2024

同样遇到了,该怎么解决啊

@Loongphy
Copy link
Contributor

Loongphy commented Jul 5, 2024

同样遇到了,该怎么解决啊

我按照上面的方法解决了,我记得是 yarn set version berry,总之,都试试吧

@summoon6
Copy link

summoon6 commented Jul 6, 2024

同样遇到了,该怎么解决啊

我按照上面的方法解决了,我记得是 yarn set version berry,总之,都试试吧

我还是无法解决,我只是想编译一份离线文档,在内网开发使用,可否帮助我编译一份
https://juejin.cn/post/7054007256584552461

@Loongphy
Copy link
Contributor

Loongphy commented Jul 8, 2024

现在我也跑不起来……

@oljc
Copy link
Member

oljc commented Jul 9, 2024

1. 开发环境准备 lerna 多包管理 和 yarn 包管理器(已有跳过此步)

检查是否安装:

lerna -v
yarn -v

如未安装使用以下命令安装:

npm install -g lerna
npm install -g yarn

2. 安装各个工作区的包依赖

yarn install
  • 安装失败确保你的网络连接稳定,也可执行 yarn cache clean 清理一下 Yarn 缓存
  • 遇到 YN0018 错误时使用 YARN_CHECKSUM_BEHAVIOR=update yarn 安装

3. 初始化项目

本步骤主要是构建文档和脚本包、建立各包间的依赖关系、打包 Icon 和组件库源代码

npm run init

yarn run init 执行报错参考:#2402

@sukbearai
Copy link

现在我也跑不起来……

现在呢?

@Loongphy
Copy link
Contributor

We need pnpm!

@github-actions github-actions bot added the 💤 Inactive Inactive issues label Sep 21, 2024
@jadelike-wine
Copy link
Contributor

同样遇到了,该怎么解决啊

我按照上面的方法解决了,我记得是 yarn set version berry,总之,都试试吧

我还是无法解决,我只是想编译一份离线文档,在内网开发使用,可否帮助我编译一份 https://juejin.cn/post/7054007256584552461

yarn set version 3.1.0
尝试一下这个

@jadelike-wine
Copy link
Contributor

jadelike-wine commented Jan 8, 2025

1. 开发环境准备 lerna 多包管理 和 yarn 包管理器(已有跳过此步)

检查是否安装:

lerna -v
yarn -v

如未安装使用以下命令安装:

npm install -g lerna
npm install -g yarn

2. 安装各个工作区的包依赖

yarn install
  • 安装失败确保你的网络连接稳定,也可执行 yarn cache clean 清理一下 Yarn 缓存
  • 遇到 YN0018 错误时使用 YARN_CHECKSUM_BEHAVIOR=update yarn 安装

3. 初始化项目

本步骤主要是构建文档和脚本包、建立各包间的依赖关系、打包 Icon 和组件库源代码

npm run init

yarn run init 执行报错参考:#2402

@oljc
我参考这个#3261
用yarn set version 3.1.0 跑通了
看样子需要在package加个"packageManager": "[email protected]",或者更新下readme?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💤 Inactive Inactive issues
Projects
None yet
Development

No branches or pull requests