You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After running nx g plugin, a clean npm install fails with peer dependency errors.
Expected Behavior
nx g plugin does not add incompatible deps to package.json
GitHub Repo
No response
Steps to Reproduce
npx create-nx-workspace@latest # 16.9.1 at time of writing# select options for Angular, integrated monorepocd new-workspace # whatever you called it above
npm i @nx/plugin # again 16.9.1 at time of writing
nx g plugin
# follow prompts
rm -rf node_modules package-lock.json
npm install
The final npm install fails with:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: nx@16.9.1
npm ERR! Found: @swc-node/register@1.4.2
npm ERR! node_modules/@swc-node/register
npm ERR! dev @swc-node/register@"~1.4.2" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional @swc-node/register@"^1.6.7" from nx@16.9.1
npm ERR! node_modules/nx
npm ERR! dev nx@"16.9.1" from the root project
npm ERR! peer nx@">= 15 <= 17" from @nx/devkit@16.9.1
npm ERR! node_modules/@nx/devkit
npm ERR! @nx/devkit@"16.9.1" from the root project
npm ERR! 11 more (@nx/angular, @nx/cypress, @nx/eslint-plugin, @nx/jest, ...)
npm ERR! 2 more (@nx/workspace, @nrwl/tao)
npm ERR!
npm ERR! Conflicting peer dependency: @swc-node/register@1.6.8
npm ERR! node_modules/@swc-node/register
npm ERR! peerOptional @swc-node/register@"^1.6.7" from nx@16.9.1
npm ERR! node_modules/nx
npm ERR! dev nx@"16.9.1" from the root project
npm ERR! peer nx@">= 15 <= 17" from @nx/devkit@16.9.1
npm ERR! node_modules/@nx/devkit
npm ERR! @nx/devkit@"16.9.1" from the root project
npm ERR! 11 more (@nx/angular, @nx/cypress, @nx/eslint-plugin, @nx/jest, ...)
npm ERR! 2 more (@nx/workspace, @nrwl/tao)
Obviously this can be fixed by manually setting the version of @swc-node/register in package.json to 1.6.7, but ideally the plugin generator shouldn't create incompatible deps.
I would argue that these swc dependencies shouldn't be added to the project's package.json at all because no local code uses them directly. Instead, they should come in as dependencies/peerDependencies of the @nx/plugin package.
Current Behavior
After running
nx g plugin
, a cleannpm install
fails with peer dependency errors.Expected Behavior
nx g plugin
does not add incompatible deps to package.jsonGitHub Repo
No response
Steps to Reproduce
The final
npm install
fails with:Obviously this can be fixed by manually setting the version of
@swc-node/register
in package.json to1.6.7
, but ideally the plugin generator shouldn't create incompatible deps.Nx Report
Failure Logs
No response
Package Manager Version
No response
Operating System
Additional Information
No response
The text was updated successfully, but these errors were encountered: