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

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

Closed
luckman212 opened this issue Mar 11, 2021 · 6 comments
Assignees
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release

Comments

@luckman212
Copy link

luckman212 commented Mar 11, 2021

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
@luckman212 luckman212 added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Mar 11, 2021
@luckman212
Copy link
Author

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

@luckman212 luckman212 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 Apr 27, 2021
@luckman212 luckman212 reopened this May 3, 2021
@darcyclarke darcyclarke added Priority 1 high priority issue and removed Needs Triage needs review for next steps labels May 7, 2021
@darcyclarke
Copy link
Contributor

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

@wraithgar wraithgar self-assigned this Feb 22, 2022
@wraithgar
Copy link
Member

#4495

@wraithgar
Copy link
Member

Fixed in v8.5.4

@luckman212
Copy link
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

@Tim4497
Copy link

Tim4497 commented Mar 31, 2022

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
Labels
Bug thing that needs fixing Priority 1 high priority issue Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests

4 participants