Fix npm install - #1220
Conversation
There seems to have been a hiccup when refactoring the temp dir for NPM. See how [the tempDir variable](coreybutler@7de073e#diff-c4d480f687d74c39997fc58e33d300c73cfb458321c2ab26c765772db70a679eL498) was modified -- the line to unzip then proceeds to unzip from the wrong location. This should solve coreybutler#1209 -- untested.
|
hope review asap |
|
Can confirm this fixes the issue of npm not being downloaded because it doesn't recognize the temporary folder. Built the source myself with this code to confirm. Thank you kiwkwag. |
|
like |
BinToss
left a comment
There was a problem hiding this comment.
Looks good! I've mentally followed the code paths up to Line 799. I also compared a3ce311 to 7de073e for good measure. See https://diffy.org/diff/a336cbca25d7f.
For reviewers' convenience, the filesystem structure of the root directory:
> tree /F nvm-install-1862240460
Folder PATH listing for volume Blade 17
Volume serial number is B0CE-64DF
C:\USERS\NOAH\APPDATA\LOCAL\TEMP\NVM-INSTALL-1862240460
├───temp
│ npm-v6.14.11.zip
│
└───v14.16.0
│ node64.exe
│
└───node_modules
Points of interest in which filesystem paths matter:
- L671:
rootis assignedos.MkdirTemp("", "nvm-install-*").- Example:
%TEMP%\nvm-install-1862240460\.
- Example:
- L741:
web.GetNpm(root, getNpmVersion(version))downloads the NPM ZIP tofilepath.Join(root, "temp", "npm-v"+npmv+".zip")- Example:
%TEMP%\nvm-install-1862240460\temp\npm-v6.14.11.zip.
- Example:
- L746:
tempDiris assignedos.MkdirTemp("", "nvm-npm-*").- Example:
%TEMP%\nvm-npm-0123456789\
- Example:
- L759:
tempNpmBinis assignedfilepath.Join(tempDir, "nvm-npm", "cli-"+npmv, "bin"), but "cli-" will be replaced with "npm-" for NPM <6.2.0 (at L763).- Examples:
- if NPM >= 6.2.0:
%TEMP%\nvm-npm-0123456789\nvm-npm\cli-6.2.0\bin\ - if NPM < 6.2.0:
%TEMP%\nvm-npm-0123456789\nvm-npm\npm-6.1.0\bin\
- if NPM >= 6.2.0:
- Examples:
- L772-L779: the
npm,npm.cmd,npx, andnpx.cmdfiles are moved fromtmpNpmBinto${root}\v${version}whereinversionis the Node.js version` - L781-L785,
npmSourcePathis assignedfilepath.Join(tempDir, "nvm-npm", "npm-"+npmv), wherein "npm-" may be replaced with "cli-". - L787:
npmSourcePathis moved (renamed) tofilepath.Join(root, "v"+version, "node_modules", "npm") - L800:
filepath.Join(root, "v"+version)(Node.js + NPM) is moved toenv.rootand the installation is complete.
|
Just ran into this bug and it killed my vibe for nearly a whole day. Thanks for submitting the patch! |
|
Hey @BinToss, thanks for the review. Can you please instruct me how to proceed to get this merged? |
Now we wait for a maintainer to approve a review. Third parties can submit reviews, but cannot submit Approval reviews. |
|
🆘 |
|
Any update on this? The PR has been open since 5 months. |
|
This PR won't be used because the fix is more involved than a one-liner. I've already completed the work, but the release is held up by the arm64 build. GitHub recently added support for this in GitHub Actions, but I've exceeded the maximum GitHub Actions minutes with other projects over the last two months. I anticipate getting this build process complete this month, but my primary focus has been on Author/Runtime (the successor to this project). Please remember, I am the only person doing any reviews/support on this. My time is finite and my primary focus is on what's next (because I'm as tired of the slow update cycles as everyone else is). I appreciate everyone's understanding. |
|
This PR is stale because it has been open 45 days with no activity. |
|
Curious with this being such a breaking issue and a small change why is this not merged and new version of nvm published? |
|
This PR is stale because it has been open 45 days with no activity. |
|
A fixed release is available here along with updated readme and build configs (was this vibe-coded?) |
This worked, but I had to add the |
|
This PR is stale because it has been open 45 days with no activity. |
|
@coreybutler I understand your time is finite, can you please consider delegating review approval with write access into someone with more bandwidth? You said you would do it in a month in May, and it's understandable you haven't had time but maybe this is why delegating into someone that would have write access could be interesting for the community your app built. Thanks. |
|
This PR is stale because it has been open 45 days with no activity. |
|
Unstale. |
|
This PR is stale because it has been open 45 days with no activity. |
|
Xmas unstale |
|
This PR is stale because it has been open 45 days with no activity. |
|
Almost February 2026 unstale |
|
nothing can justify keeping a project broken for a year because of one simple broken file path. Mark the project as archived to let everyone know it's broken for good and won't be fixed OR review the small fixes and publish a version with only the hotfixes if the new feature review / major version is too time consuming. Any quality problem this big (not working at all) with this small of a fix and this little care will reflect on any successor project, this need attention ! |
|
@rbenzazon This is the last I'm going to comment on the subject, because this is wasting time across multiple issues. You have options:
I understand you feel this is a simple fix, but utilities like this aren't just about writing code, as I've previously detailed. If you feel I should just give up and archive the project because the pace doesn't suit your taste, it's fine by me if you hold that opinion. For those telling me to delegate to someone else, that is a luxury I don't have. There isn't anyone to delegate the administrative work to and nobody has ever offered. I don't see a point in onboarding new administrative maintainers for a sunsetting project though. |
no one is saying to archive or anything like that, update the readme and direct users to one of the 5 forks fixing this issue |
Bad take. It's not fixing the code that's the issue, it's releasing it. |
|
actually, the problem is just that users shouldn't know about which version works and which doesn't, since the npm registry has a @latest which is supposed to be stable, I understand that the current latest has a purpose of being a transition, but maybe it was released too early before it passed all the tests. Personally I won't install manually the old node version I need, what's the point of using nvm then? I won't manually downgrade nvm either, it's either latest or I won't use it at all. I completely avoided what I had to try with the old version because I lost too much time researching and arguing the issue, I'm just disappointed that nvm wasn't stable enough. I also had some issues with other major packages recently that have completely broken latest version on npm (nuxt with storybook), I guess it's a bad trend. If I can give my advice : focus on stability before new features, always keep the latest in perfect working order. It sounds simple and it's not but it deserves attention. Thanks you @coreybutler for this useful contribution, I'm sure you spend a lot of time working on it, but your project has become critical for many people and we take it for granted. Please take our criticism as constructive, it's not personal. maybe the release process could use some more automation and streamlining to relieve your work charge. |
|
This PR is stale because it has been open 45 days with no activity. |
|
Look, we can continue to comment here (ill advised, he's told us all we needed to know) and continue getting nowhere, or fork the thing (maybe rewrite it in a more modern language, avoid becoming a "benevolent dictatorship" as forks usually tend to) and then let them tools (ours and his) live their lives. |
|
I've completed v2. None of these PRs are relevant anymore. Several announcements coming as soon as we wrap up deployment testing. |
|
This PR is stale because it has been open 45 days with no activity. |
|
bump |
It's been fixed in source, but releases are failing. |
|
This PR is stale because it has been open 45 days with no activity. |


There seems to have been a hiccup when refactoring the temp dir for NPM. See how the tempDir variable was modified -- the line to unzip then proceeds to unzip from the wrong location. This should solve #1209 -- untested. Need to make sure that the rest of the flow works...