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

Fails to install npm with moving tar-extracted contents #227

Open
KSR-Yasuda opened this issue Jul 30, 2019 · 3 comments
Open

Fails to install npm with moving tar-extracted contents #227

KSR-Yasuda opened this issue Jul 30, 2019 · 3 comments

Comments

@KSR-Yasuda
Copy link

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\.

@nullivex
Copy link
Member

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

@KSR-Yasuda
Copy link
Author

@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.

@jreast
Copy link

jreast commented Oct 2, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants