Skip to content

fix: clarify Connect uses npm in Node.js lockfile error#787

Merged
dotNomad merged 1 commit into
mainfrom
dotnomad/nodejs-npm-error-messaging
Jun 22, 2026
Merged

fix: clarify Connect uses npm in Node.js lockfile error#787
dotNomad merged 1 commit into
mainfrom
dotnomad/nodejs-npm-error-messaging

Conversation

@dotNomad

@dotNomad dotNomad commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Intent

A publisher who builds a Node.js project with yarn or pnpm has no package-lock.json, so rsconnect deploy nodejs fails with an error that asks for package-lock.json without explaining that Connect specifically requires npm. This adds that clarification.

Type of Change

  • Bug Fix

Approach

rsconnect/environment_node.py: the NodeEnvironment.create lockfile check now adds the sentence "Connect installs Node.js dependencies with npm." to the raised RSConnectException. The message is unconditional - no yarn.lock/pnpm-lock.yaml detection - so it reads correctly in every case.

Automated Tests

tests/test_environment_node.py::test_create_no_lock_file now asserts the exception text includes the npm clarification.

Directions for Reviewers

In a Node.js project directory with a package.json but no package-lock.json, run rsconnect deploy nodejs. The error names npm as the package manager Connect uses.

Checklist

  • I have updated CHANGELOG.md to cover notable changes.
  • I have updated all related GitHub issues to reflect their current state.
  • I have run the rsconnect-python-tests-at-night workflow in Connect against this feature branch.

@github-actions

github-actions Bot commented Jun 22, 2026

Copy link
Copy Markdown
PR Preview Action v1.8.1
Preview removed because the pull request was closed.
2026-06-22 17:43 UTC

@dotNomad dotNomad requested review from joshyam-k and mleary June 22, 2026 17:19
@dotNomad dotNomad marked this pull request as ready for review June 22, 2026 17:19
The "No package-lock.json found" error raised when deploying Node.js
content now states that Connect installs Node.js dependencies with npm,
so publishers who build with yarn or pnpm understand why the lock file
is required.

Part of posit-dev/connect#40767

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@dotNomad dotNomad force-pushed the dotnomad/nodejs-npm-error-messaging branch from ff64221 to 2131496 Compare June 22, 2026 17:33
@dotNomad dotNomad requested review from amol- and karawoo June 22, 2026 17:34
@github-actions

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
7205 5880 82% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/environment_node.py 100% 🟢
TOTAL 100% 🟢

updated for commit: 2131496 by action🐍

@dotNomad dotNomad merged commit 639c5b8 into main Jun 22, 2026
24 checks passed
@dotNomad dotNomad deleted the dotnomad/nodejs-npm-error-messaging branch June 22, 2026 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants