nodejs/corepack

Add quite mode when download file

Mr-Python-in-China opened this issue · 1 comments

I'm working in a devcontainer. The project uses yarn 4 and I wrote it in packageManager. I wrote RUN corepack enable in Dockerfile, then I use "postCreateCommand": "yarn" in devcontainer.json. However, I have to press "enter" to allow NodeJS download yarn.

[7802 ms] Start: Run in container: /bin/sh -c yarn
Corepack is about to download https://repo.yarnpkg.com/4.2.1/packages/yarnpkg-cli/bin/yarn.js.

Do you want to continue? [Y/n] 

Is there any way to download the package manager automatically?

corepack/README.md

Lines 246 to 252 in a62cd7b

- `COREPACK_ENABLE_DOWNLOAD_PROMPT` can be set to `0` to
prevent Corepack showing the URL when it needs to download software, or can be
set to `1` to have the URL shown. By default, when Corepack is called
explicitly (e.g. `corepack pnpm …`), it is set to `0`; when Corepack is called
implicitely (e.g. `pnpm …`), it is set to `1`.
When standard input is a TTY and no CI environment is detected, Corepack will
ask for user input before starting the download.