arco-design / arco-design-vue

A Vue.js 3 UI Library based on Arco Design
https://arco.design/vue
MIT License
2.6k stars 502 forks source link

yarn install, init 失败 #2841

Open peixin opened 7 months ago

peixin commented 7 months ago

基本信息

预期结果

正常 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" 又不一样。

根据 https://github.com/arco-design/arco-design-vue/issues/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 commented 7 months ago

+1

uxuip commented 7 months ago

遇到同样的问题

longshihui commented 7 months ago

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

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

https://github.com/yarnpkg/berry/issues/3597#issuecomment-955872793

image
JedediahXu commented 6 months ago

基本信息

  • 依赖包名 及 版本: @arco-design/web-vue@2.53.3
  • 浏览器版本: 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 commented 2 months ago

同样的问题

image

summoon6 commented 1 week ago

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

Loongphy commented 1 week ago

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

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

summoon6 commented 1 week ago

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

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

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

Loongphy commented 1 week ago

现在我也跑不起来……

oljc commented 1 week ago

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

检查是否安装:

lerna -v
yarn -v

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

npm install -g lerna
npm install -g yarn

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

yarn install

3. 初始化项目

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

npm run init

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