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

removeDependenciesFromPackageJson: Ensure dependencies field exist #30222

Open
4 tasks
GrandSchtroumpf opened this issue Feb 28, 2025 · 0 comments · May be fixed by #30224
Open
4 tasks

removeDependenciesFromPackageJson: Ensure dependencies field exist #30222

GrandSchtroumpf opened this issue Feb 28, 2025 · 0 comments · May be fixed by #30224

Comments

@GrandSchtroumpf
Copy link

GrandSchtroumpf commented Feb 28, 2025

Current Behavior

If there is no field dependencies or devDependencies migration that removes deps fails

Expected Behavior

It should work. Add a if statement here :
packages/devkit/src/utils/package-json.ts

      for (const dep of dependencies) {
        if (json.dependencies) delete json.dependencies[dep];
      }
      for (const devDep of devDependencies) {
        if (json.devDependencies) delete json.devDependencies[devDep];
      }

GitHub Repo

No response

Steps to Reproduce

  1. Remove dependencies from your package.json
  2. Run a migration that remove a dependency

Nx Report

...

Failure Logs

Package Manager Version

No response

Operating System

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

Additional Information

No response

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

Successfully merging a pull request may close this issue.

1 participant