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

Failed to find apps/<app-name>/package.json when run the command #46

Closed
destnguyxn2 opened this issue Sep 15, 2023 · 4 comments · Fixed by #47
Closed

Failed to find apps/<app-name>/package.json when run the command #46

destnguyxn2 opened this issue Sep 15, 2023 · 4 comments · Fixed by #47
Assignees
Labels
bug Something isn't working

Comments

@destnguyxn2
Copy link

Hello,

When I try to run the plugin using nx run-many, the plugin try to find the package.json in the dỉectory of each application end raise an error ENOENT: no such file or directory since there is only project.json

It is not make the command failed but seem annoying when I try to read the console log. Could you check this please?

Thank you

@koliveira15 koliveira15 self-assigned this Sep 16, 2023
@koliveira15 koliveira15 added the bug Something isn't working label Sep 16, 2023
@gcko
Copy link
Contributor

gcko commented Sep 27, 2023

@koliveira15 The issue for me is that I define a package.json at the root level, and not for each application. Reading the code in utils.js, I notice that it is expecting each application to have a package.json file. I suggest you add a fallback to check the root directory for a package.json file and use the version from there

@gcko
Copy link
Contributor

gcko commented Sep 27, 2023

@destnguyxn a "quick fix" to remove the error is to add projectVersion to your sonar options:

{
...
"sonar": {
      "executor": "@koliveira15/nx-sonarqube:scan",
      "options": {
        "projectVersion": "1.0",
        ...
      }
    }
  }
}

@destnguyxn2
Copy link
Author

@gcko the plugin does have a fallback to the root directory when not found the package.json , it just the error message seems annoying and may cause misunderstanding.

Thank you for the quick fix 😄

@gcko
Copy link
Contributor

gcko commented Sep 28, 2023

@destnguyxn ah! well in that case, the solution would be to change it from an ERROR to an INFO message, or WARN

@koliveira15 koliveira15 linked a pull request Sep 30, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants