nodists / nodist

Natural node.js and npm version manager for windows.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Fails to install npm with moving tar-extracted contents

KSR-Yasuda opened this issue · comments

In nodist npm SOME_NPM_VERSION, it fails to install.

  • nodist v0.9.1
  • Windows 8.1 Pro (x64)
C:\Program Files (x86)\Nodist\npmv>nodist npm 6
npm 6
https://codeload.github.com/npm/cli/tar.gz/v6.10.2 [===============] 5419/5524 KiB 98% 0.5s
C:\Program Files (x86)\Nodist\npmv>npm -v
internal/modules/cjs/loader.js:638
    throw err;
    ^

Error: Cannot find module 'C:\Program Files (x86)\Nodist\npmv\6.10.2\bin\npm-cli.js'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:829:12)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

It extracts the target ver. of npm into the dir named node-tar-extract in the current dir.
But after the extraction, it fails to move the contents into C:\Program Files (x86)\Nodist\npmv\.

@KSR-Yasuda could it permission related and failing to elevate on the move to the final destination?
Are you running that command as Administrator?

@nullivex

Are you running that command as Administrator?

Yes, it fails even though running nodist in Admin-mode command prompt window.

And it creates an empty dir of the target npm version in C:\Program Files (x86)\Nodist\npmv\
(e.g. In nodist npm 6.10.0, it creates C:\Program Files (x86)\Nodist\npmv\6.10.0 dir,
but extracts no sub entry in the 6.10.0 dir).
It is no matter whether Admin prompt or normal user prompt.

Seeing this, I think it has enough file access privilege.

It extracts the npm tar archive into node-tar-extract dir in the current dir of the nodist execution.
So it looks as if it is just forgetting to move the entries extracted.

I had this same issue. I managed to resolve it by an npm --depth 9999 update in my nodist folder.
This pulled in a new version of a number of dependencies including tar not sure if that is to blame.

As I'd already broken my npm install I had to delete the broken version from the nodist\npmv folder and nodist npm global 6.9.0 to switch back to a working npm before then doing the update to the nodist packages.

I'm not sure if the necessary fix is just an update of the tar packages and its dependencies.

Edit: For some reason node-promisepipe had a 3.0.0 package.json but was actually an earlier version of the index.js - reinstalling this removed the q dependency.