为什么“npm doctor"会产生权限错误? [英] Why does 'npm doctor' produce permission errors?

查看:69
本文介绍了为什么“npm doctor"会产生权限错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我运行 npm doctor 时,我收到了以前从未见过的权限错误:

When I run npm doctor I get permission errors that I have not seen before:

Perms check on local bin folder     not ok  Check the permissions of files in /Users/Orome/node_modules/.bin
Perms check on global bin folder    not ok  Check the permissions of files in /usr/local/bin

我没有做任何我知道会导致此更改的更改.

I've made no changes that I'm aware of that would have caused this change.

这是什么原因造成的,我该怎么办?

What is causing this and what can I do about it?

npm doctor 的完整输出:

npm WARN checkFilesPermission error getting info for /Users/Orome/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.0.10, latest: v6.14.8
node -v                             ok      current: v15.2.0, recommended: v15.2.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/Orome/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 9656 tarballs

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

配置:

macOS: 10.15.7-x86_64
CPU: quad-core 64-bit haswell
HOMEBREW_VERSION: 2.5.9-52-g8cffae8
HOMEBREW_PREFIX: /usr/local
Clang: 12.0 build 1200
Java: 1.8.0_172
CLT: 12.1.0.0.1.1602137645
Xcode: 12.1

推荐答案

看来 Homebrew 和 node 可能会失去同步并因此产生此错误.无论如何简单

It seems that Homebrew and node can get out of sync and produce this error as a result. In any case simply

npm install -g npm

照顾它.

这篇关于为什么“npm doctor"会产生权限错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆