RN 配置的坑1

安装 npm install -g yarn react-native-cli 出现如下错误:

npm ERR! Darwin 14.5.0
npm ERR! argv “/usr/local/Cellar/node/5.5.0/bin/node” “/usr/local/bin/npm” “install” “–save” “react-native”
npm ERR! node v5.5.0
npm ERR! npm v3.5.3
npm ERR! path /Users/marksong/.npm/ws/0.8.1
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir ‘/Users/marksong/.npm/ws/0.8.1’
npm ERR! at Error (native)
npm ERR! { [Error: EACCES: permission denied, mkdir ‘/Users/marksong/.npm/ws/0.8.1’]
npm ERR! errno: -13,
npm ERR! code: ‘EACCES’,
npm ERR! syscall: ‘mkdir’,
npm ERR! path: ‘/Users/marksong/.npm/ws/0.8.1’,
npm ERR! parent: ‘react-native’ }
npm ERR!
npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request:
npm ERR! /Users/marksong/Desktop/Project(demo)/BookSearch/npm-debug.log

npm install --save react-native failed

这是由于权限问题
解决方案 : 1 先执行 sudo chown -R whoami /usr/local
再来执行: 2 npm install -g yarn react-native-cli
这期间我开启了vpn,稍微快点

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值