Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Nx release publish missing nx-release-publish target #30241

Open
1 of 4 tasks
olivier-lxo opened this issue Mar 3, 2025 · 1 comment
Open
1 of 4 tasks

Nx release publish missing nx-release-publish target #30241

olivier-lxo opened this issue Mar 3, 2025 · 1 comment

Comments

@olivier-lxo
Copy link

olivier-lxo commented Mar 3, 2025

Current Behavior

I'm trying to run nx release in two steps so that I don't generate a changelog.
When trying to run nx release publish after nx release version I get an error stating that the nx-release-publish target is missing.

Expected Behavior

Running nx release publish should be possible.

GitHub Repo

Here is the reproduction repository: https://github.com/olivier-lxo/nx-publish-error-repro

Steps to Reproduce

  1. Repository initiated with npx create-nx-workspace nx-publish-error-repro --preset=ts (no code formatting, CI provider or remote caching)

  2. Added lib with npx nx g @nx/js:lib packages/mytslib (and manually fixed node types to v22, maybe could be fixed as well?)

  3. Adding minimal release config "projects": [ "packages/*" ] to nx.json

  4. Bumping version with npx nx release version

  5. Attempt at publishing package with npx nx release publish (doesn't matter if using --dry-run or not) fails with error:

$ npx nx release publish  --verbose

 NX   Based on your config, the following projects were matched for publishing but do not have the "nx-release-publish" target specified:

- @nx-publish-error-repro/mytslib

This is usually caused by not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "nx-release-publish" target for you automatically.

Error: Based on your config, the following projects were matched for publishing but do not have the "nx-release-publish" target specified:
- @nx-publish-error-repro/mytslib

This is usually caused by not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "nx-release-publish" target for you automatically.

    at runPublishOnProjects (/tmp/nx-publish-error-repro/node_modules/nx/src/command-line/release/publish.js:153:15)
    at releasePublish (/tmp/nx-publish-error-repro/node_modules/nx/src/command-line/release/publish.js:96:49)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at /tmp/nx-publish-error-repro/node_modules/nx/src/command-line/release/publish.js:21:35
    at handleErrors (/tmp/nx-publish-error-repro/node_modules/nx/src/utils/handle-errors.js:8:24)
    at Object.handler (/tmp/nx-publish-error-repro/node_modules/nx/src/command-line/release/command-object.js:199:24)

Nx Report

Node           : 22.13.1
OS             : linux-x64
Native Target  : x86_64-linux
npm            : 10.9.2

nx             : 20.4.6
@nx/js         : 20.4.6
@nx/workspace  : 20.4.6
@nx/devkit     : 20.4.6
typescript     : 5.7.3
---------------------------------------
Registered Plugins:
@nx/js/typescript

Failure Logs

$ npx nx release publish  --verbose

 NX   Based on your config, the following projects were matched for publishing but do not have the "nx-release-publish" target specified:

- @nx-publish-error-repro/mytslib

This is usually caused by not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "nx-release-publish" target for you automatically.

Error: Based on your config, the following projects were matched for publishing but do not have the "nx-release-publish" target specified:
- @nx-publish-error-repro/mytslib

This is usually caused by not having an appropriate plugin, such as "@nx/js" installed, which will add the appropriate "nx-release-publish" target for you automatically.

    at runPublishOnProjects (/tmp/nx-publish-error-repro/node_modules/nx/src/command-line/release/publish.js:153:15)
    at releasePublish (/tmp/nx-publish-error-repro/node_modules/nx/src/command-line/release/publish.js:96:49)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at /tmp/nx-publish-error-repro/node_modules/nx/src/command-line/release/publish.js:21:35
    at handleErrors (/tmp/nx-publish-error-repro/node_modules/nx/src/utils/handle-errors.js:8:24)
    at Object.handler (/tmp/nx-publish-error-repro/node_modules/nx/src/command-line/release/command-object.js:199:24)

Package Manager Version

10.9.2

Operating System

  • macOS
  • Linux
  • Windows
  • Other (Please specify)

Additional Information

No response

@olivier-lxo olivier-lxo changed the title Nx release publish throwing error Nx release publish missing nx-release-publish target Mar 3, 2025
@olivier-lxo
Copy link
Author

I just had the same error while invoking nx release without any sub-command even though it did run previously.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant