2

I have a project that depends on nodegit.

When I run
npm install -g .

I get this output at some point:

output1

When npm finishes installing, I lose access to it in the path:

output2

I end up having to run 'n', to change to a previous version of node, then run 'n' again to change to the latest version of node and in the end run 'npm install -g npm@latest' to get the latest version of npm.

Jonny C
  • 1,943
  • 3
  • 20
  • 36
André Alçada Padez
  • 10,987
  • 24
  • 67
  • 120

2 Answers2

1

It looks like you are trying to install NodeGit. (Or maybe you are installing something that depends on NodeGit?) Assuming you are installing NodeGit, that is not a CLI tool and should not be installed globally. It installs npm as a dependency. Your installation is failing for whatever reason, and as part of cleanup, it is uninstalling npm.

If you are installing NodeGit, do not install it with -g.

If you are trying to install something that isn't NodeGit, you need to either change directories to that project folder or (more likely) change your installation command line.

If you are installing something that depends on NodeGit and really should be installed globally, you'll need to identify why your installation is failing (which it appears to be failing at the pruning of dev dependencies, but I can't tell why from the output--might be file permissions, might be something else). As long as NodeGit installation fails, it will unbuild npm.

Trott
  • 66,479
  • 23
  • 173
  • 212
  • thanks. I am succeeding in installing my project as a global cli tool. that project depends on nodegit, and it's while running install -g on my tool that nodegit unbuilds npm. – André Alçada Padez May 12 '15 at 16:14
0

This is actually an issue with the nodegit project. You can follow it in https://github.com/nodegit/nodegit/issues/561 which led to https://github.com/nodegit/nodegit/issues/567

Nothing i can do but wait.

André Alçada Padez
  • 10,987
  • 24
  • 67
  • 120