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

Global installations do not work on a specific Windows scenario #44

Closed
m-s- opened this issue Oct 12, 2021 · 0 comments · Fixed by #46
Closed

Global installations do not work on a specific Windows scenario #44

m-s- opened this issue Oct 12, 2021 · 0 comments · Fixed by #46
Labels
bug Something isn't working

Comments

@m-s-
Copy link
Collaborator

m-s- commented Oct 12, 2021

The basic case for the global cli installations is currently not working. Steps to reproduce:

  1. install Node using the official MSI (I tested with version 14 but seems to happen in other versions)
  2. install cli globally: npm i -g @criticalmanufacturing/cli
  3. set env variable or run with DEBUG=cmf:*
  4. run cmf -h

No help menu is shown because the node shim that invokes the cli binary thinks it was installed locally and not globally.

This is due to a bug with sindresorhus/is-installed-globally. In this case, npm is installed inside %APPDATA% and not under the node prefix, which by default is C:\Program Files\nodejs but is-installed-globally does not account for this scenario.

A simple fix could be checking if the node shim is inside %APPDATA%.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant