backstage / backstage

Backstage is an open framework for building developer portals
https://backstage.io/
Apache License 2.0
27.53k stars 5.83k forks source link

πŸ› Bug Report: Not able to add `common-library` plugin using `yarn add` #25083

Open athira-sabu opened 3 months ago

athira-sabu commented 3 months ago

πŸ“œ Description

I created a plugin that can be used for frontend and backend using command yarn new -> select plugin-common It got created. But when I try to add it to my plugins or backend getting below error,

❯ yarn --cwd packages/backend add @internal/backstage-plugin-notifications-common
yarn add v1.22.19
[1/4] πŸ”  Resolving packages...
error An unexpected error occurred: "https://registry.yarnpkg.com/@internal%2fbackstage-plugin-notifications-common: Not found".
info If you think this is a bug, please open a bug report with the information provided in "/Users/athira.sabu/Athira/backstage/packages/backend/yarn-error.log".
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

πŸ‘ Expected behavior

Should add package @internal/backstage-plugin-notifications-common in package.json

πŸ‘Ž Actual Behavior with Screenshots

Getting error package not found

πŸ‘Ÿ Reproduction steps

  1. Create common plugin using yarn new -> select plugin-common
  2. Try to add using command yarn add packages/backend <plugin-name>

πŸ“ƒ Provide the context for the Bug.

No response

πŸ–₯️ Your Environment

OS: Darwin 21.5.0 - darwin/x64 node: v20.12.1 yarn: 1.22.19 cli: 0.26.6 (installed) backstage: 1.27.0

πŸ‘€ Have you spent some time to check if this bug has been raised before?

🏒 Have you read the Code of Conduct?

Are you willing to submit PR?

None

awanlin commented 3 months ago

This seems like a duplicate of: https://github.com/backstage/backstage/issues/25063

It would be really helpful to include details steps to reproduce, like what folders you were in for each step to help better understand where commands were being ran.

athira-sabu commented 3 months ago

Sure @awanlin , In the project, I have both frontend and backend plugins. I need to share some common types between these plugins, ('notifications-backend' and 'notifications').

benjdlambert commented 3 months ago

@Athira-Sabu I think that the issue linked from @awanlin is going to help you. I think that this looks like a yarn@1.x bug, and upgrading to yarn@4 will solve a lot of these issues.

Wonder if we should look at shipping something other that yarn@1 in create-app soon too.

awanlin commented 3 months ago

Yes, was thinking about the fact that we should update create-app as well @benjdlambert. πŸ‘

github-actions[bot] commented 3 weeks ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.