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

node should be a package dependency #586

Closed
m-roll opened this issue Nov 1, 2021 · 4 comments
Closed

node should be a package dependency #586

m-roll opened this issue Nov 1, 2021 · 4 comments

Comments

@m-roll
Copy link
Contributor

m-roll commented Nov 1, 2021

Description and Context

When running npm update -g @hubspot/cli@next or npm update -g @hubspot/cli@latest, both npm and hs aren't discoverable via $PATH (seems binaries/symlinks get removed), if this is the only global package installed. This does not seem to happen when running npm update @hubspot/cli.

Steps to reproduce

  1. Run npm update -g @hubspot/cli@latest
  2. npm will not be found by shell.

I believe the issue is that node needs to be a dependency of the CLI. When updating, it uses package.json to update the tree, sees that node isn't required, and then removes the cli. I think this only happens when all user packages do not have node as a dependency, it just so happens this is the only global user package I have.

Expected behavior

npm and hs remain in path

Screenshots

Screen Shot 2021-11-01 at 2 35 56 PM

Who to Notify

@anthmatic

@miketalley
Copy link
Contributor

Hey @m-roll thanks for posting this! I'm curious if this has to do with using npm instead of yarn for installing/updating the CLI. Have you tried using yarn global add @hubspot/cli@next?

@gcorne
Copy link
Contributor

gcorne commented Nov 29, 2021

I think this is an npm bug that was fixed. See npm/cli#2736

@m-roll
Copy link
Contributor Author

m-roll commented Nov 29, 2021

For some context, this issue (npm/cli#2014 (comment)) seems to indicate that this is not a bug but I think that comment is outdated/incorrect. Thanks for linking that issue.

@miketalley Perhaps that is the case, although I would think that npm would work just as well with package.json. If yarn is required we should call that out in the readme, since we currently recommend installing via npm. Seems like this isn't an issue if this is due to a bug though.

Edit: I'm using npm version 8.1.4 which is allegedly after this fix? Still seeing this behavior 🤔

@miketalley
Copy link
Contributor

Thanks for the reference @gcorne. I'm going to close this out. @m-roll be sure to comment if you are still seeing any issues.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants