coder / coder/code-server

[Fix]: Better output when installing with NPM

未关闭
#5,537 1 条评论 1 个 reaction 已指派 1 人 已被 @edvincent 认领 在 GitHub 查看
enhancement
主要语言
TypeScript
星标
79.3k
派生
6.8k
平均合并
2 天 6 小时
30 天内合并 PR
41

描述

## Why do you want this feature?

In the `postinstall.sh` script that is used when installing with `npm`, we use nested commands to install `vscode` and its extensions - [see code](https://github.com/coder/code-server/blob/main/ci/build/npm-postinstall.sh#L156)

As reported in https://github.com/coder/code-server/issues/5530 (and more in https://github.com/coder/code-server/pull/5533), installs were passing but actually failing - and only was seen during runtime.

The nested installs were failing, but the errors weren't being bubbled-up... Was only seen when using `--foreground-scripts`.

## What is your suggestion?
* NPM 8 needs to be passed `--foreground-scripts` to actually see the output of the nested. We should update the doc to show that as a troubleshooting step in here: https://coder.com/docs/code-server/latest/npm#debugging-install-issues-with-npm
* I would expect the overall script to have a non-0 exit code if any of the nested scripts failed (i.e. they themselves had a non-0 exit code) which would make the overall `npm install` fail. Need to investigate that.

## Are there any workarounds to get this functionality today?
* Pass `--foreground-scripts` and read carefully :(

## Are you interested in submitting a PR for this?
Yes

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。