NativeScript / NativeScript/nativescript-cli

Unable to use Yarn 2+

オープン
#5,662 コメント 6 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

bug-pending-triage
主要言語
JavaScript
スター
1.1k
フォーク
204
平均マージ
1日 9時間
マージ済み PR(30日)
8

説明

Issue Description

I'm trying to use yarn as my package manager, but ns build android fails with the following error: Command failed: yarn config get registry.

Seems like that config value doesn't exist anymore in Yarn 2+. It may have been renamed to the following:

❯ yarn config get npmRegistryServer
https://registry.yarnpkg.com

This seems to be the place where the command is ran:
https://github.com/NativeScript/nativescript-cli/blob/bb3a6965792cc565ab6d516c30a640ac98313ee7/lib/yarn-package-manager.ts#L127

Reproduction

Steps I've taken:

  1. corepack enable
  2. yarn set version berry
  3. yarn install
  4. Removed package-lock.json
  5. ns package-manager set yarn
  6. ns clean
  7. ns build android
Relevant log output (if applicable)
Build output:

❯ ns build android
(node:28069) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /workspaces/way-app/node_modules/vuex/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
Preparing project...
(node:28118) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /workspaces/way-app/node_modules/vuex/package.json.
Update this package.json to use a subpath pattern like "./*".
(Use `node --trace-deprecation ...` to show where the warning was created)
assets by path assets/flags/*.png 53.2 KiB
  asset assets/flags/bn.png 847 bytes [compared for emit] [from: app/assets/flags/bn.png] [copied]
  + 195 assets
assets by path fonts/ 6.48 MiB 41 assets
assets by path assets/css/ 147 KiB
  assets by path assets/css/*.scss 17.1 KiB 7 assets
  assets by path assets/css/*.css 130 KiB 2 assets
assets by path *.js 13.5 MiB
  asset vendor.js 11.5 MiB [compared for emit] (name: vendor) (id hint: defaultVendor)
  asset bundle.js 2.06 MiB [compared for emit] (name: bundle)
  asset runtime.js 13.2 KiB [compared for emit] (name: runtime)
assets by path assets/json/*.json 186 KiB
  asset assets/json/LottieSpinningCar.json 92.9 KiB [compared for emit] [from: app/assets/json/LottieSpinningCar.json] [copied]
  asset assets/json/LottieTest.json 92.9 KiB [compared for emit] [from: app/assets/json/LottieTest.json] [copied]
asset assets/images/NativeScript-Vue.png 8.22 KiB [compared for emit] [from: app/assets/images/NativeScript-Vue.png] [copied]
Entrypoint bundle 13.5 MiB = runtime.js 13.2 KiB vendor.js 11.5 MiB bundle.js 2.06 MiB
runtime modules 2.84 KiB 9 modules
orphan modules 542 bytes [orphan] 7 modules
modules by path ./node_modules/ 4.33 MiB
  javascript modules 4.07 MiB 510 modules
  json modules 273 KiB
    modules by path ./node_modules/mdn-data/css/*.json 242 KiB 3 modules
    modules by path ./node_modules/css-tree/ 30.7 KiB 2 modules
modules by path ./app/ 559 KiB 437 modules
external "~/package.json" 42 bytes [optional] [built] [code generated]
webpack 5.71.0 compiled successfully in 7030 ms
Webpack compilation complete.
(node:28069) [DEP0148] DeprecationWarning: Use of deprecated folder mapping "./" in the "exports" field module resolution of the package at /workspaces/way-app/node_modules/@nativescript/core/node_modules/tslib/package.json.
Update this package.json to use a subpath pattern like "./*".
Command failed: yarn config get registry


### Environment

Using Yarn 3.2.0
Using Node 16.14.0

### Please accept these terms

- [X] I have searched the [existing issues](https://github.com/NativeScript/nativescript-cli/issues) as well as [StackOverflow](https://stackoverflow.com/questions/tagged/nativescript) and this has not been posted before
- [X] This is a bug report
- [X] I agree to follow this project's [Code of Conduct](https://github.com/NativeScript/NativeScript/blob/master/tools/notes/CONTRIBUTING.md#coc)

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

lib/yarn-package-manager.ts の 127 行目付近で参照されているコマンドから始め、記載されている NativeScript のセットアップと ns build android を使用して Yarn 3.2.0 で再現します。関連する Yarn 設定の検索を確認し、報告されたコマンド失敗なしに Android ビルドが完了することを検証します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
android, javascript, node.js
領域
build-system, cli, mobile-dev
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
停滞
明瞭さ
明確に書かれている
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。