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

ncu -g errorously reports everything up to date when there's broken symlinks #235

Closed
stipsan opened this issue May 4, 2016 · 7 comments
Closed

Comments

@stipsan
Copy link

stipsan commented May 4, 2016

If you have a broken symlink in your global node_modules ncu will fall back to the default "Everything is up to date:-)" message.
It's pretty easy to encounter this if your contributor workflow involves npm link on forks of other peoples npm packages to test your patches before submitting your PRs.
If it's a one-off contribution it's likely you'll delete your local git checkout and replace the symlink with the version tag that contains the changes from your PR and all is fine in userland.

Except you forgot to remove the symlink in the global node_modules folder and the next time you run ncu -g you'll start to get suspicious when there's 6 months since you updated your global deps and you can't believe none of your deps is outdated yet.
Also, this happens: npm/npm#12342

It's out of scope to expect ncu reporting broken symlinks as an extra service. But it would be nice if it simply ignored broken symlinks and reported the other deps status as usual 😃

@raineorshine
Copy link
Owner

Thank you for reporting. I thought that ncu was just ignoring broken symlinks and still checking other dependencies as normal. Are you saying that your other deps are not getting updated either?

@stipsan
Copy link
Author

stipsan commented May 9, 2016

Yes, that's exactly what I'm saying.

Here's a screenshot of what happens before I symlink a package (the package is material-ui), after the symlink is done and after I leave the symlink in the global node_modules but delete its target:

skjermbilde 2016-05-09 kl 14 21 35

Steps to reproduce:

  1. git clone any npm module
  2. cd into the local checkout and do npm link.
  3. rm . -vrf and from now on ncu -g will always say All global packages are up-to-date :) until the broken symlink is nuked 😨

I don't know how npm-check-updates works internally but I have a hunch this issue may be related: npm/npm#9564

Maybe add it to a FAQ of known issues while waiting for npm to fix it?

@raineorshine
Copy link
Owner

Thank you for the clear explanation and steps to reproduce! Will definitely
document and investigate.

On Mon, May 9, 2016 at 6:27 AM Stian Didriksen notifications@github.com
wrote:

Yes, that's exactly what I'm saying.

Here's a screenshot of what happens before I symlink a package, after the
symlink is done and after I leave the symlink in the global node_modules
but delete its target:

[image: skjermbilde 2016-05-09 kl 14 21 35]
https://cloud.githubusercontent.com/assets/81981/15112926/917f749a-15f1-11e6-95dc-a661809e3c4e.png

Steps to reproduce:

  1. git clone any npm module
  2. cd into the local checkout and do npm link.
  3. rm . -vrf and from now on ncu -g will always say All global packages
    are up-to-date :) until the broken symlink is nuked 😨

I don't know how npm-check-updates works internally but I have a hunch
this issue may be related: npm/npm#9564
npm/npm#9564

Maybe add it to a FAQ of known issues while waiting for npm to fix it?


You are receiving this because you commented.

Reply to this email directly or view it on GitHub
#235 (comment)

@raineorshine
Copy link
Owner

It appears this is very much the result of npm/npm#9564. I'll be watching that issue closely.

@raineorshine
Copy link
Owner

For others who are experiencing this issue, a quick way to way to see if you have dead symlinks is this:

$ less $(npm -g prefix)/lib/node_modules/*

If anything says No such file or directory, that's your problem. Delete the dead link and it should clear it up.

@tejeswar491
Copy link

How do we resolve the issue? If I do ncu(picks it from from package.json and even on bower.json), it says upto date. But shows the versions upgrade needed when I go into each dependency file and do ncu -m bower.json. I did "$ less $(npm -g prefix)/lib/node_modules/", and says "** is a directory".

@raineorshine
Copy link
Owner

@tejeswar491 npm/npm#9564 needs to be fixed since this is a dependency bug.

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

No branches or pull requests

3 participants