【问题标题】:Permission errors with 'npm doctor' following Big Sur 11.2 upgradeBig Sur 11.2 升级后“npm doctor”的权限错误
【发布时间】:2022-01-16 00:11:00
【问题描述】:

自从更新到 Big Sur 11.2 后,当我运行 npm doctor 时,我得到:

npm WARN checkFilesPermission error getting info for /Users/Rax/node_modules/.bin
npm ERR! checkFilesPermission Missing permissions on /usr/local/bin/.keepme (expect: executable)
Check                               Value   Recommendation/Notes
npm ping                            ok
npm -v                              ok      current: v7.5.4, latest: v7.5.4
node -v                             ok      current: v15.8.0, recommended: v15.8.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   ok
Perms check on global node_modules  ok
Perms check on local bin folder     not ok  Check the permissions of files in /Users/Rax/node_modules/.bin
Perms check on global bin folder    not ok  Check the permissions of files in /usr/local/bin
Verify cache contents               ok      verified 10156 tarballs

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

过去针对类似问题的解决方案 that worked 无法解决此问题,这似乎是与 Big Sur 相关的一个明显问题。

如何纠正这些权限错误,或者它们可能是 Big Sur 11.2 上 npm 的已知错误?


HOMEBREW_VERSION: 3.0.1-74-g74fd6c8
CPU: quad-core 64-bit haswell
Clang: 12.0 build 1200
macOS: 11.2.1-x86_64
CLT: 12.0.32.27
Xcode: 12.4
npm: 7.5.4
node: v15.8.0

【问题讨论】:

    标签: npm macos-big-sur


    【解决方案1】:

    见:https://github.com/npm/cli/issues/2856

    然而,

    mkdir ~/node_modules/.bin
    chmod +x /usr/local/bin/.keepme
    

    应该解决

    npm WARN checkFilesPermission error getting info for /Users/Rax/node_modules/.bin
    npm ERR! checkFilesPermission Missing permissions on /usr/local/bin/.keepme (expect: executable)
    Perms check on local bin folder not ok  Check the permissions of files in /Users/Rax/node_modules/.bin
    

    【讨论】:

      猜你喜欢
      • 2021-07-23
      • 2021-03-03
      • 2021-02-26
      • 2021-07-28
      • 1970-01-01
      • 2021-02-24
      • 2021-02-28
      • 1970-01-01
      • 2021-06-19
      相关资源
      最近更新 更多