-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
Verify latest release
- I verified that the issue exists in the latest pnpm release
pnpm version
No response
Which area(s) of pnpm are affected? (leave empty if unsure)
CLI
Link to the code that reproduces this issue or a replay of the bug
No response
Reproduction steps
- Make a project with a built dependency.
- Add this to
onlyBuiltDependenciesin your package.json. pnpm install- Make Dockerfile per instructions in https://pnpm.io/cli/fetch.
- Build the Docker image.
Result: The dependency will not be built.
Describe the Bug
Per the guides at https://pnpm.io/cli/fetch, pnpm fetch needs only the pnpm-lock.yaml and patches. However, onlyBuiltDependencies is only tracked within the package.json which is explicitly not required for pnpm fetch. This means that when pnpm fetch runs it will not build the dependency. The subsequent pnpm install will also not rebuild the dependency, just using the unbuilt version from pnpm fetch.
Expected Behavior
I would expect the dependency to be built. One possible solution is to encode dependency build state in the pnpm-lock.yaml. Alternative, pnpm install should check to see if the dependencies listed in onlyBuiltDependencies have been installed and build them if not.
Which Node.js version are you using?
22.13.0
Which operating systems have you used?
- macOS
- Windows
- Linux
If your OS is a Linux based, which one it is? (Include the version if relevant)
No response