mac npm install gulp失败

报错如下:

gyp ERR! configure error 

gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/gulp/node_modules/fsevents/.node-gyp'

gyp ERR! System Darwin 18.0.0

gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/gulp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node" "--module_name=fse" "--module_path=/usr/local/lib/node_modules/gulp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64" "--napi_version=3" "--node_abi_napi=napi"

gyp ERR! cwd /usr/local/lib/node_modules/gulp/node_modules/fsevents

gyp ERR! node -v v10.15.0

gyp ERR! node-gyp -v v3.8.0

gyp ERR! not ok 

node-pre-gyp ERR! build error 

node-pre-gyp ERR! stack Error: Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/gulp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64/fse.node --module_name=fse --module_path=/usr/local/lib/node_modules/gulp/node_modules/fsevents/lib/binding/Release/node-v64-darwin-x64 --napi_version=3 --node_abi_napi=napi' (1)

node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/gulp/node_modules/fsevents/node_modules/node-pre-gyp/lib/util/compile.js:83:29)

node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:182:13)

node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:962:16)

node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:251:5)

node-pre-gyp ERR! System Darwin 18.0.0

node-pre-gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/gulp/node_modules/fsevents/node_modules/node-pre-gyp/bin/node-pre-gyp" "install" "--fallback-to-build"

node-pre-gyp ERR! cwd /usr/local/lib/node_modules/gulp/node_modules/fsevents

node-pre-gyp ERR! node -v v10.15.0

node-pre-gyp ERR! node-pre-gyp -v v0.10.3

node-pre-gyp ERR! not ok 

查阅资料后再安装gulp命令加入--unsafe-perm,即:

 sudo npm install gulp --unsafe-perm -g

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值