angular/angular-ja

[提案; 討論] `yarn@2.x.x` への移行

IRod22 opened this issue · 1 comments

#749 の翻訳を準備するために開発サーバーを起動したときに、このエラーが発生しました。

> yarn start
C:\Users\<my-username>\angular-ja\.yarn\cache\zx-npm-7.1.1-6b099ad8f3-6cf326f7cf.zip\node_modules\zx\build\cli.js:15
import fs from 'fs-extra';
^^^^^^

SyntaxError: Cannot use import statement outside a module
    at Object.compileFunction (node:vm:352:18)
    at wrapSafe (node:internal/modules/cjs/loader:1027:15)
    at Module._compile (node:internal/modules/cjs/loader:1063:27)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
    at Module.load (node:internal/modules/cjs/loader:975:32)
    at Function.external_module_.Module._load (C:\Users\Robotics\angular-ja\.pnp.js:8513:14)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47

Node.js v17.8.0
>

zx に報告すればよかったのですが、ファイルのインポートスタックが見えませんでした。 エラーは #789 に関係しているのだろうか。その PR で失敗した CI を確認し、テストは Windows 仮想マシンで実行されました。

アップデート

Dependabot からのプル リクエストのチェックが遅くなるか、ゼロ以外の終了コードで停止することに気付きました。これは yarn@1.22.19 がパフォーマンスの更新を受信していないことに関係しているのだろうか。このリポジトリまたはメイン リポジトリで yarn@1.22.19必要 でない限り、ほぼ 3 年間使用されている yarn@2.x.x に切り替えることをお勧めします。

A notable thing is Yarn is required by the original angular/angular repository. Even if we drop using Yarn, we still have to depend on Yarn to build AIO artifacts.

https://github.com/angular/angular/blob/main/aio/package.json#L61

However, I also think we can switch our package manager from Yarn for dependencies of angular-ja itself. But in my opinion, the best solution is not Yarn v2+. There are alternatives like npm, pnpm, or something I don't know yet. This is should be filed as an issue but not prioritized highly.