Npm Operation Not permitted issue

时间:2017-04-06 17:18:21

标签: macos npm terminal

I am actually trying to run sudo npm -g install bower but my mac does not let me run anything that has npm on it. The error is

Error: EPERM: operation not permitted, mkdir '/usr/ps2791'

See the picture below.

Error Screenshot

2 个答案:

答案 0 :(得分:0)

您使用的是最新的Mac OSX> 10.10?因为默认情况下所有MAC OSX都启用了SIP。为了使用npm命令。在mac os上禁用SIP。

答案 1 :(得分:0)

根据this answer,您可能需要将npm前缀设置为您的用户实际可以操作的目录。即。

mkdir ~/npm_config
npm config set prefix ~/npm_config