loopbackio / loopbackio/loopback-next
In an extension, Loopback CLI depends on @loopback/core in list of dependencies
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.1k
- Forks
- 1.1k
- Avg merge
- 2d 21h
- Merged PRs (30d)
- 27
Description
### Describe the bug
Running CLI commands such as `lb4 model` in a loopback extension cause the commands to be aborted.
```No change to package.json was detected. No package manager install will be executed.
Generation is aborted: Error: No `@loopback/core` package found in the "dependencies" section of C:\Users\Ben\Documents\dev\customer-service\extensions\intercom\package.json. The command must be run in a LoopBack project.
```
This is because `@loopback/core` is not listed in dependencies. Yes it is both a `devDependency` and a `peerDependency` in a loopback extension. This was last discussed in #2163 and implemented in #2166.
Wouldn't it be a better developer experience if the command accepted `@loopback/core` as a `peerDependency`?
### Logs
```shell
$ lb4 model
No change to package.json was detected. No package manager install will be executed.
Generation is aborted: Error: No `@loopback/core` package found in the "dependencies" section of C:\Users\Ben\Documents\dev\customer-service\extensions\intercom\package.json. The command must be run in a LoopBack project.
```
### Additional information
_No response_
### Reproduction
n/a
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the `lb4 model` CLI entry point and trace the dependency check that reports the missing `@loopback/core` package. Reproduce the command in a LoopBack extension where `@loopback/core` is a peerDependency; done means the command is accepted without requiring it in `dependencies`.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100