jfrog-cli icon indicating copy to clipboard operation
jfrog-cli copied to clipboard

"jf npm pkg set" does not handle quotation marks correctly.

Open lauravuo opened this issue 1 year ago • 1 comments

Describe the bug

When running jf npm pkg set license="UNLICENSED" for an npm project the output is as following:

{
  "error": {
    "code": null,
    "summary": "Unexpected token 'U', \"UNLICENSED\" is not valid JSON",
    "detail": ""
  }
}

Instead of error, npm package license should be set correctly.

Current behavior

Following error is returned:

{
  "error": {
    "code": null,
    "summary": "Unexpected token 'U', \"UNLICENSED\" is not valid JSON",
    "detail": ""
  }
}

Reproduction steps

Configure JF with npm-config. Run jf npm pkg set license="UNLICENSED" to set the npm package license.

Expected behavior

License is set correctly for the package (as is without using jf cli).

JFrog CLI version

2.73.2

Operating system type and version

Apple M1 Pro Sequoia 15.2

JFrog Artifactory version

No response

JFrog Xray version

No response

lauravuo avatar Jan 31 '25 13:01 lauravuo

The workaround is to use escape chars: jf npm pkg set license=\"UNLICENSED\" but this is not intuitive approach.

lauravuo avatar Jan 31 '25 13:01 lauravuo

This issue has been marked as stale due to 6 months of inactivity. As part of our effort to address every issue properly, please feel free to remove the stale label or keep this issue active by leaving a comment. Otherwise, it will be closed in 7 days

github-actions[bot] avatar Jul 31 '25 00:07 github-actions[bot]

This issue was closed due to 7 days of inactivity after being marked as stale. Feel free to reopen it if it remains relevant.

github-actions[bot] avatar Aug 07 '25 00:08 github-actions[bot]