Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

one-step repair of node_modules folder in bad state #6349

Closed
StevenACoffman opened this issue Sep 29, 2014 · 4 comments
Closed

one-step repair of node_modules folder in bad state #6349

StevenACoffman opened this issue Sep 29, 2014 · 4 comments

Comments

@StevenACoffman
Copy link

I have globally installed yeoman as well as some other command line utilities, and whether it was due to unreliable internet during install or something else, when I do npm update, I have lots of warnings like:

npm ERR! ENOTEMPTY, rmdir '/usr/local/lib/node_modules/yeoman-generator/node_modules/file-utils/node_modules'

If I do sudo npm -g list, I see lots of unmet dependencies (and a couple invalids).
I can figure out what the root thing is (e.g. yo), do an sudo npm -g remove yo and then sudo npm -g install yo and then things are resolved. However, there are plenty of other global utilities (nodeschool workshoppers, etc.) that still have problems. It would be great if I could just "npm -g update" and it would install unmet dependencies, or maybe "npm -g fixup" or something. Maybe something like that already exists, and it could be added to the wiki troubleshooting page.

@othiym23 othiym23 added this to the multi-stage install milestone Sep 29, 2014
@othiym23
Copy link
Contributor

It's most useful if you can include your node and npm versions with these kinds of issues (and maybe an npm-debug.log file for failed installs) so we know which issues have or haven't been fixed in npm since the version you're running. That said:

  • npm -g update is currently broken as designed; we intend to fix it in the short- to medium-term.
  • making it so that a regular npm install will go through and fix all of the issues with the current project's dependencies is a project that's being tackled by @iarna under the rubric "multi-stage install" (which is the milestone I've tagged this issue onto).
  • Once these two issues have been addressed, npm -g update is (I believe) the tool you're looking for, but we also want to add a command analogous to Homebrew's brew doctor that checks the current project (and your npm environment) to ensure they're in a good state.

@StevenACoffman
Copy link
Author

Thank you. Is there an already an open issue for the proposed "npm doctor" enhancement?
For reference:

npm -version
2.0.2
node --version
v0.10.32

@othiym23
Copy link
Contributor

Nope, but there is some discussion here and there in the issues. For now, I've retitled this issue to better reflect what you're asking for.

@othiym23 othiym23 changed the title Fix old unmet dependencies, rmdir ENOTEMPTY warnings one-step repair of node_modules folder in bad state Oct 1, 2014
@iarna
Copy link
Contributor

iarna commented Dec 12, 2014

This is going to be implemented under #6913. As such, I'm going to close this ticket and any further discussion should occur over there.

@iarna iarna closed this as completed Dec 12, 2014
@npm npm locked and limited conversation to collaborators Jun 24, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants