-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Umm...wow. The salt.states.npm module is not checking for the existence of npm correctly. #51811
Comments
Jesus christ guys. Will write up another PR in a sec... |
Closed by PR #51812. |
Okay. So I was able to track this down while working on the PR. It's a windows-specific issue and it seems like a common construct. Will write further results on analysis in PR #51812. |
Okay, the PR has been re-created PR #51812 is deprecated in favor of PR #51813. This properly fixes the version check on the Windows platform and has been tested. For some reason on the Windows platform the call to just When testing via |
thanks for the PR :) |
Fixed the salt.modules.npm module to check the npm version correctly on the Windows platform
Closing as the PR was merged. |
Description of Issue/Question
The
salt.states.npm
module doesn't work because it's checking for npm support incorrectly. Back in 2017, some guy renamed thesalt.modules.list
function tosalt.modules.list_
which broke the npm module entirely.The reason being is that in order to verify that npm support is available, the following check is made:
Due to this states module checking for
npm.list
instead of the correctnpm.list_
, the npm state module can't be used.Setup
This apparently has been (not) working this way since 2017-06-04. Write up a state that uses
npm.installed
as you will use it to repro this issue.Steps to Reproduce Issue
Once you apply the state, you will see that it claims it's unable to locate the npm binary. This is a misnomer because if you try and exec
cmd.which
for npm, it will totally find it (assuming you use my PR #51785 if you're on Windows)Versions Report
This is in the develop branch, there's no need for versions here because you can literally see the code discrepancy. As a review look at
salt.states.npm
and thensalt.modules.npm.
salt.states.npm:31
salt.modules.npm:237
:The text was updated successfully, but these errors were encountered: