Bug 986422 - `npm ls -g` outputs false errors
`npm ls -g` outputs false errors
Status: CLOSED EOL
Product: Fedora
Classification: Fedora
Component: npm (Show other bugs)
21
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: T.C. Hollingsworth
Fedora Extras Quality Assurance
:
: 1125868 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-07-19 13:56 EDT by relaxcold
Modified: 2015-12-02 11:05 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1271290 (view as bug list)
Environment:
Last Closed: 2015-12-01 21:54:07 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
npm_list_errors (4.93 KB, text/plain)
2013-07-19 13:56 EDT, relaxcold
no flags Details

  None (edit)
Description relaxcold 2013-07-19 13:56:07 EDT
Created attachment 775905 [details]
npm_list_errors

Description of problem:
When I try to install npm with yum, it pulls in both

  dependency: npm(inherits) >= 1
   provider: nodejs-inherits1.noarch 1.0.0-11.fc19
   provider: nodejs-inherits.noarch 2.0.0-3.fc19
  dependency: npm(inherits) < 2
   provider: nodejs-inherits1.noarch 1.0.0-11.fc19
   provider: nodejs-inherits.noarch 1.0.0-7.fc19

when I check in /usr/lib/node_modules there is a link from inherits -> inherits@2.

When I then do a npm list -g, I get the errors shown in the attachment "npm_list_errors"



Version-Release number of selected component (if applicable):


How reproducible: always 


Steps to Reproduce:
1. Yum install npm
2. npm list -g to view the list of installed modules along with the errors

Actual results:
I get the list of errors/conflicts as shown in the attachment "npm_list_errors"

Expected results:
I expected no errors or conflicts in the list of installed modules

Additional info:
Comment 1 T.C. Hollingsworth 2013-07-19 16:33:10 EDT
(In reply to relaxcold from comment #0)
> Description of problem:
> When I try to install npm with yum, it pulls in both
> 
>   dependency: npm(inherits) >= 1
>    provider: nodejs-inherits1.noarch 1.0.0-11.fc19
>    provider: nodejs-inherits.noarch 2.0.0-3.fc19
>   dependency: npm(inherits) < 2
>    provider: nodejs-inherits1.noarch 1.0.0-11.fc19
>    provider: nodejs-inherits.noarch 1.0.0-7.fc19

This is intended, and matches upstream's bundled modules:
[tc@zathras]~/dev/npm/node_modules% find -path "*/inherits/package.json" -exec grep '"version"' {} \;
  "version": "2.0.0",
  "version": "1.0.0",

There's nothing wrong with this, it's  one of the reasons node supports multiple levels of node_modules directories.  ;-)

> when I check in /usr/lib/node_modules there is a link from inherits ->
> inherits@2.
>
> When I then do a npm list -g, I get the errors shown in the attachment
> "npm_list_errors"

npm checks things differently depending on what level in the hierarchy it's in and gets it wrong sometimes.  I'm looking into it.

For example, in your output there's:
>  ├─┬ block-stream@0.0.6
>    │ └── UNMET DEPENDENCY inherits *

But you'll notice if you `cd` in there that `npm ls` is happy:

[tc@zathras]/usr/lib/node_modules/block-stream% npm ls
block-stream@0.0.6 /usr/lib/node_modules/block-stream
└── inherits@1.0.0 -> /usr/lib/node_modules/inherits@1

Only `npm ls -g` is confused, require() still works flawlessly and `npm ls` works fine everywhere else in the filesystem, so npm works just fine (besides the incorrect errors it spits out).  The errors can be safely ignored for now, and they'll get shut up soon enough. ;-)

Sorry for the trouble, and thanks for the report!
Comment 2 relaxcold 2013-07-22 12:11:25 EDT
Thank you for the feedback on the issue.

I was unsure if the conflicts npm found could cause problem in the nodejs programs, but I understand you as this is not the case.
Comment 3 Dominic Cleal 2013-11-07 04:14:43 EST
This also affects the npm package provider in the puppetlabs-nodejs Puppet module, since it detects the non-zero exit code from the npm ls and assumes the package listing failed.  It then assumes there aren't any modules installed.

# puppet resource package -d | grep npm | head -2
Debug: Executing '/usr/bin/npm list --json --global'
Debug: Error: npm list --json command error Execution of '/usr/bin/npm list --json --global' returned 1: npm WARN unmet dependency /usr/lib/node_modules/block-stream requires inherits@'~2.0.0' but will load
Comment 4 Christopher Ng 2013-11-14 08:14:38 EST
I also have this problem with puppetlabs-nodejs.
Comment 5 Dominic Cleal 2013-11-14 08:22:12 EST
(In reply to dnd1066 from comment #4)
> I also have this problem with puppetlabs-nodejs.

https://github.com/puppetlabs/puppetlabs-nodejs/pull/56 may help you.
Comment 6 T.C. Hollingsworth 2014-08-01 16:26:16 EDT
*** Bug 1125868 has been marked as a duplicate of this bug. ***
Comment 7 Fedora End Of Life 2015-01-09 17:12:49 EST
This message is a notice that Fedora 19 is now at end of life. Fedora 
has stopped maintaining and issuing updates for Fedora 19. It is 
Fedora's policy to close all bug reports from releases that are no 
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 19 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 8 Jason Woods 2015-01-26 10:02:55 EST
I am seeing this issue with RedHat 6.6 machine

$ npm list -g
npm ERR! missing: inherits@*, required by undefined@undefined
npm ERR! missing: inherits@*, required by block-stream@0.0.7
npm ERR! missing: inherits@*, required by fstream@0.1.24
npm ERR! missing: inherits@*, required by fstream-ignore@0.0.7
npm ERR! missing: inherits@*, required by fstream-npm@0.1.5
npm ERR! missing: inherits@*, required by glob@3.2.6
npm ERR! invalid: inherits@2.0.0 /usr/lib/node_modules/inherits@2
npm ERR! missing: inherits@*, required by npmconf@0.1.2
npm ERR! missing: inherits@*, required by tar@0.1.18
npm ERR! not ok code 0

$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.6 (Santiago)

If I remove the symlink at /usr/lib/node_modules/inherits (which points to inherits@2), and rename the directory /usr/lib/node_modules/inherits@2 to inherits, everything works again. Looks like npm list -g does not support symlinks
Comment 9 Jason Woods 2015-01-26 10:04:13 EST
Relevant package that has the symlinks and causes this problem is "nodejs-inherits-2.0.0-4.el6.noarch"
Comment 10 Eric Work 2015-02-14 02:44:52 EST
I observe the same issue on Fedora 21.  The fix was the procedure Jason described in comment #8.  When I remove the symlink and move the real directory to the location of the symlink I get no warnings at all when I do "npm ls -g".  Maybe this should be fixed in nodejs-inherits?
Comment 11 Tom Hughes 2015-02-14 03:06:35 EST
Removing the symlink is not the answer - that is an essential part of our packaging scheme for node modules that have multiple versions packaged. It points to the latest version so that, for example, "npm link inherits" picks up the latest version.
Comment 12 Fedora End Of Life 2015-11-04 10:41:04 EST
This message is a reminder that Fedora 21 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 21. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '21'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 21 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 13 Fedora End Of Life 2015-12-01 21:54:12 EST
Fedora 21 changed to end-of-life (EOL) status on 2015-12-01. Fedora 21 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

Note You need to log in before you can comment on or make changes to this bug.