Repository navigation
fix(cli): find npm on windows when updating - #2
Merged
Merged
Conversation
Updating ran the package manager by its bare name, which Windows only finds as an .exe. npm is npm.cmd there, so every update failed with 'program not found', and the failure was then kept quiet for a day. The package manager is now looked up by the names Windows can run, next to SkillPouch and on PATH, and the dashboard keeps saying a release is out, with the command to install it, while a failed version waits to be tried again.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Self-update never worked on Windows.
Cause: the update ran
npmby its bare name. Rust only finds.exefiles that way on Windows, and npm there isnpm.cmd(the extensionlessnpmnext to it is a shell script Windows can't run). So the first check failed with "program not found", and the failure was remembered for 24 hours, so later launches showed nothing.Fix:
npm.cmd,pnpm.exe/pnpm.cmd,bun.exe), in the install folder first, then onPATH.Test: a temp folder laid out like Windows (
npmscript in the npm prefix,npm+npm.cmdin the Node folder) resolves tonpm.cmd; reverting the fix fails the test. Workspace: 271 tests pass, fmt and clippy clean.Releases as a patch (
fix). Copies already on 0.4.0 or earlier can't update themselves on Windows; runnpm i -g skillpouchonce.