Skip to content

[BUG] npm doctor erroneously reports permissions problem for nonexistent ~/node_modules & /.bin #2856

Closed

Description

@luckman212

Environment:

  • OS: macOS 11.3
  • Node: 16.0.0
  • npm: 7.11.2

There's a problem with npm doctor reporting not ok Check the permissions of files in $HOME/node_modules (should be owned by current user) for Perms check, even when those directories don't exist. Started around 7.5.x I believe, sorry not sure exactly which version. But continues as of 7.11.2.

image

$ pwd
/Users/luke

$ npm doctor
npm WARN checkFilesPermission error getting info for /Users/luke/node_modules
npm WARN checkFilesPermission error getting info for /Users/luke/node_modules/.bin
Check                               Value   Recommendation/Notes
npm ping                            ok
npm -v                              ok      current: v7.11.1, latest: v7.11.1
node -v                             ok      current: v16.0.0, recommended: v16.0.0
npm config get registry             ok      using default registry (https://registry.npmjs.org/)
which git                           ok      /usr/local/bin/git
Perms check on cached files         ok
Perms check on local node_modules   not ok  Check the permissions of files in /Users/luke/node_modules (should be owned by current user)
Perms check on global node_modules  ok
Perms check on local bin folder     not ok  Check the permissions of files in /Users/luke/node_modules/.bin
Perms check on global bin folder    ok
Verify cache contents               ok      verified 3148 tarballs

npm ERR! Some problems found. See above for recommendations.

$ stat /Users/luke/node_modules
stat: /Users/luke/node_modules: stat: No such file or directory
$ stat /Users/luke/node_modules/.bin
stat: /Users/luke/node_modules/.bin: stat: No such file or directory

Activity

  1. added
    Bugthing that needs fixing
    Needs Triageneeds review for next steps
    Release 7.xwork is associated with a specific npm 7 release
    on Mar 11, 2021
  2. luckman212 commented on Apr 18, 2021

    @luckman212
    Author

    Anyone else seeing this? Is it a mis-configuration on my end?

  3. changed the title [-][BUG] npm doctor erroneously reports permissions problem for ~/node_modules[/-] [+][BUG] npm doctor erroneously reports permissions problem for nonexistent ~/node_modules & /.bin[/+] on Apr 27, 2021
  4. added and removed
    Needs Triageneeds review for next steps
    on May 7, 2021
  5. darcyclarke commented on May 7, 2021

    @darcyclarke
    Contributor

    Known issue with npm doctor at the moment; Needs much love... setting priority accordingly

  6. self-assigned this
    on Feb 22, 2022
  7. wraithgar commented on Mar 3, 2022

    @wraithgar
    Contributor
  8. wraithgar commented on Mar 10, 2022

    @wraithgar
    Contributor

    Fixed in v8.5.4

  9. luckman212 commented on Mar 10, 2022

    @luckman212
    Author

    Thanks @wraithgar

    Confirmed! 🚀

    $ npm doctor
    Check                               Value  Recommendation/Notes
    npm ping                            ok
    npm -v                              ok     current: v8.5.4, latest: v8.5.4
    node -v                             ok     current: v17.7.0, recommended: v17.7.0
    npm config get registry             ok     using default registry (https://registry.npmjs.org/)
    which git                           ok     /opt/homebrew/bin/git
    Perms check on cached files         ok
    Perms check on local node_modules   ok
    Perms check on global node_modules  ok
    Perms check on local bin folder     ok
    Perms check on global bin folder    ok
    Verify cache contents               ok     verified 5473 tarballs
    
  10. Tim4497 commented on Mar 31, 2022

    @Tim4497

    same for me but I have over 1000 warnings:

    Check                               Value   Recommendation/Notes
    npm ping                            ok
    npm -v                              ok      current: v8.5.5, latest: v8.5.5
    node -v                             ok      current: v16.14.2, recommended: v16.14.2
    npm config get registry             ok      using default registry (https://registry.npmjs.org/)
    which git                           ok      /usr/local/bin/git
    Perms check on cached files         not ok  Check the permissions of files in /Users/tim/.npm (should be owned by current user)
    Perms check on local node_modules   not ok  Check the permissions of files in /Users/tim/node_modules (should be owned by current user)
    Perms check on global node_modules  ok
    Perms check on local bin folder     ok
    Perms check on global bin folder    not ok  Check the permissions of files in /usr/local/bin
    Verify cache contents               ok      verified 7487 tarballs
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Bugthing that needs fixingPriority 1high priority issueRelease 7.xwork is associated with a specific npm 7 release

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions