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 add on a GitHub dependency when changing tag does not install on first try #6966

Closed
2 of 4 tasks
MattIPv4 opened this issue Aug 20, 2023 · 0 comments · Fixed by #6974
Closed
2 of 4 tasks

pnpm add on a GitHub dependency when changing tag does not install on first try #6966

MattIPv4 opened this issue Aug 20, 2023 · 0 comments · Fixed by #6974

Comments

@MattIPv4
Copy link

MattIPv4 commented Aug 20, 2023

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)

No response

Link to the code that reproduces this issue or a replay of the bug

No response

Reproduction steps

pnpm init

pnpm add github:alveusgg/data\#0.18.1

# ...
# dependencies:
# + @alveusgg/data 0.18.1
# ...

cat package.json

# Observe 0.18.1 listed

cat pnpm-lock.yaml

# Observe 0.18.1 listed twice

pnpm add github:alveusgg/data\#0.18.2

# Already up to date
# ...

cat package.json

# Observe 0.18.2 listed

cat pnpm-lock.yaml

# Observe 0.18.2 listed + 0.18.1 listed

pnpm-lock.yaml as the end:

lockfileVersion: '6.0'

settings:
  autoInstallPeers: true
  excludeLinksFromLockfile: false

dependencies:
  '@alveusgg/data':
    specifier: github:alveusgg/data#0.18.2
    version: github.com/alveusgg/data/16fa6a031097b61b6394fb0facc32a69dc1ec4d0 # This hash is for 0.18.1, not 0.18.2

packages:

  github.com/alveusgg/data/16fa6a031097b61b6394fb0facc32a69dc1ec4d0:
    resolution: {tarball: https://codeload.github.com/alveusgg/data/tar.gz/16fa6a031097b61b6394fb0facc32a69dc1ec4d0}
    name: '@alveusgg/data'
    version: 0.18.1
    dev: false

It is also worth noting that if the same add command is run again, it then suddenly works:

pnpm add github:alveusgg/data\#0.18.2

# ...
# dependencies:
# - @alveusgg/data 0.18.1
# + @alveusgg/data 0.18.2
# ...

Describe the Bug

When running pnpm add with a new tag for an existing GitHub dependency, the specifier for the dependency is updated, but the new version is not actually installed. If the command is run a second time, the new version is then added.

Expected Behavior

I would expect the new version to be installed when I run the command the first time, as the specifier I am using has changed.

Which Node.js version are you using?

18.16.1

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

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.

1 participant