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

pnpm does not fail when adding a non existing package from the local file system #7159

Closed
2 of 4 tasks
singhshashi opened this issue Oct 4, 2023 · 3 comments · Fixed by #7222
Closed
2 of 4 tasks

Comments

@singhshashi
Copy link

singhshashi commented Oct 4, 2023

Verify latest release

  • I verified that the issue exists in the latest pnpm release

pnpm version

8.8.0

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

https://github.com/singhshashi/issue-pnpm

Reproduction steps

  1. Just start with a bare repo
  2. pnpm init
  3. Now add a package from the local file system that does not exists (pnpm add ../proac)
  4. pnpm should fail but it succeeds in adding a non existent package.
    Screenshot 2023-10-04 at 3 51 30 PM

Describe the Bug

When I provide an incorrect location of a package from my local file system, then pnpm should fail with the error message that the package does not exist. However, it succeeds and adds the non existent package to the package.json

Expected Behavior

Since there is nothing at the location I provided, pnpm add should fail giving an error that nothing exists at the given location.

Which Node.js version are you using?

18.15.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

@zkochan
Copy link
Member

zkochan commented Oct 6, 2023

We can print a warning but this works as expected. Users asked for this to work like this.

@singhshashi
Copy link
Author

I guess a warning works as well. I do find it odd that you would add a non existent package to package.json.

@zkochan
Copy link
Member

zkochan commented Oct 20, 2023

I do find it odd that you would add a non existent package to package.json.

When the directory at the target location will be created, the broken symlink will become valid.

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.

2 participants