Open
Conversation
3 tasks
Check for npm at the start of configure() instead of failing late in buildQuartoPreviewJs() after ~300MB of downloads. When npm is missing, emit a warning explaining that the quarto preview live-reload feature will not be available, then skip the quarto-preview.js build step. The rest of Quarto (render, pdf, publish) builds and runs normally.
A half-built Quarto without quarto-preview.js would later fail at runtime when `quarto preview` tries to read the missing file, producing another confusing error. Requiring npm upfront keeps the contract simple: configure succeeds only if all required tools are available.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On systems without
npm,./configure.shdownloads ~300MB of dependencies (Deno, Pandoc, Dart Sass, esbuild, Typst) before finally failing with a crypticNotFound: Failed to spawn 'npm': entity not foundfrom thebuildQuartoPreviewJs()step.Root Cause
configure()inpackage/src/common/configure.tsruns the dependency download loop before callingbuildQuartoPreviewJs(), which is the only step in configure that requiresnpm. Thenpmexecutable is used to buildsrc/resources/preview/quarto-preview.js— the webui that powers thequarto previewlive-reload feature.Fix
Check
npmpresence upfront using the existingwhich()helper fromsrc/core/path.ts. If missing, throw a clear error before any downloads:This fails fast and avoids wasting download time on a build that cannot complete. A silent skip was considered but rejected — a Quarto build without
quarto-preview.jswould later fail at runtime whenquarto previewtries to read the missing file, producing another confusing error.Fixes #14420