jfrog / jfrog/jfrog-cli-security
[curation audit] jf ca with --working-dirs on npm workspace project fails with ENOWORKSPACES
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 13
- Forks
- 50
- Avg merge
- 3d 48m
- Merged PRs (30d)
- 26
Description
Describe the bug
JFrog CLI version
2.71.4 and above
Operating system
Ubuntu 24.04.4 LTS (Linux 6.17.0-22-generic)
Command
jf ca --working-dirs="<workspace-path>"
The project is an npm monorepo that utilises workspaces in the root package.json.
I am trying to run curation audit for a specific workspace directory using the --working-dirs option (both relative and absolute paths have been tested).
Setup / Environment
- Project type: npm monorepo with root
workspaces - Node.js version: 22.14.0
- Npm version: 10.9.2
- Workspace configuration in project's root package.json:
"workspaces": [
"containers/frontend",
"containers/backend",
"containers/cms",
"containers/jobs"
]
- Workspace package names:
frontend,backend,jobs - OS: Ubuntu 24.04.4 LTS (
Linux 6.17.0-22-generic) - JFrog CLI: reproducible on
2.71.4(CI), also observed on newer local CLI (2.103.0) - Registry setup: Artifactory npm virtual repo via
jf npm-config
Describe the bug
When running jf curation-audit (jf ca) with --working-dirs in an npm workspace monorepo, dependency resolution fails with npm workspace errors, even when targeting a specific workspace directory.
Commands used
JFrog setup
jf config add <server-id> --url=<artifactory-url> --user=<user> --password=<token> --interactive=false --overwrite
jf npm-config --server-id-resolve=<server-id> --repo-resolve=<npm-virtual-repo>
JFrog curation audit
# relative
jf ca --working-dirs=containers/backend
# absolute
jf ca --working-dirs=/absolute/path/to/repo/containers/backend
# multiple directories
jf ca --working-dirs="/abs/.../containers/backend,/abs/.../containers/frontend,/abs/.../containers/cms,/abs/.../containers/jobs"
Current behavior
Failure: ENOWORKSPACES
jf ca --working-dirs="/abs/.../containers/backend,/abs/.../containers/frontend,/abs/.../containers/cms,/abs/.../containers/jobs"
fails during npm dependency resolution with:
npm error code ENOWORKSPACES
npm error This command does not support workspaces.
Reproduction steps
- Use an npm project with root workspaces.
- Configure JFrog CLI and npm resolver (jf config add, jf npm-config).
Run:
jf ca --working-dirs=containers/backend
or
jf ca --working-dirs=/absolute/path/to/containers/backend
Observe npm failure: ENOWORKSPACES: This command does not support workspaces.
Expected behavior
jf ca --working-dirs=<workspace-path> should audit the specified workspace directory without triggering npm ENOWORKSPACES errors.
JFrog CLI version
2.103.0
Operating system type and version
Linux 6.17.0-22-generic (Ubuntu 24.04.4 LTS)
Additional observation that may help triage:
In my environment, the ENOWORKSPACES failure goes away when I run jf ca with --run-native and force npm to a version < 9.2 (for example, npm 9.1.2).
With npm 9.1.2 + --run-native, the curation audit works.
With my project’s current npm version (10.9.2), I hit the workspace-related failure path.
So this appears to be related to npm version compatibility/invocation behaviour in workspace mode.
JFrog Artifactory version
No response
JFrog Xray version
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the curation-audit jf ca entry point and trace how --working-dirs invokes npm for workspace projects. Reproduce with the root package.json, a workspace such as containers/backend, and npm 10.9.2; compare with npm 9.1.2 and --run-native. Done means the targeted workspace audits without an ENOWORKSPACES failure.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go, node.js
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100