native react ssh_react-native初始化项目时候报错?react-native init

问 题

sudo react-native init sapp

Password:

This will walk you through creating a new React Native project in /Users/dark/Documents/work/sapp

Using yarn v0.20.3

Installing react-native...

yarn add v0.20.3

info No lockfile found.

[1/4] ? Resolving packages...

warning There appears to be trouble with your network connection. Retrying...

warning react-native > xcode > node-uuid@1.4.7: use uuid module instead

error Received malformed response from registry for undefined. The registry may be down.

info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.

{ Error: Command failed: yarn add react-native --exact

at checkExecSyncError (child_process.js:490:13)

at execSync (child_process.js:530:13)

at run (/usr/local/lib/node_modules/react-native-cli/index.js:294:5)

at createProject (/usr/local/lib/node_modules/react-native-cli/index.js:249:3)

at init (/usr/local/lib/node_modules/react-native-cli/index.js:200:5)

at Object. (/usr/local/lib/node_modules/react-native-cli/index.js:153:7)

at Module._compile (module.js:571:32)

at Object.Module._extensions..js (module.js:580:10)

at Module.load (module.js:488:32)

at tryModuleLoad (module.js:447:12)

error: null,

cmd: 'yarn add react-native --exact',

file: '/bin/sh',

args: [ '/bin/sh', '-c', 'yarn add react-native --exact' ],

options:

{ stdio: [ [Object], [Object], [Object] ],

shell: true,

file: '/bin/sh',

args: [ '/bin/sh', '-c', 'yarn add react-native --exact' ],

envPairs:

[ 'SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.sZmHUSONNf/Listeners',

'COLORFGBG=7;0',

'LANG=zh_CN.UTF-8',

'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/dark/Documents/java/maven-3.2.3/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin:/Users/dark/.rvm/bin:/usr/local/Cellar/mongodb/3.2.0/bin',

'DISPLAY=/private/tmp/com.apple.launchd.i9Hbc6IGQ1/org.macosforge.xquartz:0',

'TERM=xterm-256color',

'HOME=/Users/dark',

'__CF_USER_TEXT_ENCODING=0x0:25:52',

'LC_CTYPE=zh_CN.UTF-8',

'LSCOLORS=Gxfxcxdxbxegedabagacad',

'MAIL=/var/mail/root',

'LOGNAME=root',

'USER=root',

'USERNAME=root',

'SHELL=/bin/sh',

'SUDO_COMMAND=/usr/local/bin/react-native init sapp',

'SUDO_USER=dark',

'SUDO_UID=501',

'SUDO_GID=20' ] },

envPairs:

[ 'SSH_AUTH_SOCK=/private/tmp/com.apple.launchd.sZmHUSONNf/Listeners',

'COLORFGBG=7;0',

'LANG=zh_CN.UTF-8',

'PATH=/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/dark/Documents/java/maven-3.2.3/bin:/Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin:/Users/dark/.rvm/bin:/usr/local/Cellar/mongodb/3.2.0/bin',

'DISPLAY=/private/tmp/com.apple.launchd.i9Hbc6IGQ1/org.macosforge.xquartz:0',

'TERM=xterm-256color',

'HOME=/Users/dark',

'__CF_USER_TEXT_ENCODING=0x0:25:52',

'LC_CTYPE=zh_CN.UTF-8',

'LSCOLORS=Gxfxcxdxbxegedabagacad',

'MAIL=/var/mail/root',

'LOGNAME=root',

'USER=root',

'USERNAME=root',

'SHELL=/bin/sh',

'SUDO_COMMAND=/usr/local/bin/react-native init sapp',

'SUDO_USER=dark',

'SUDO_UID=501',

'SUDO_GID=20' ],

stderr: null,

stdout: null,

pid: 7395,

output: [ null, null, null ],

signal: null,

status: 1 }

Command yarn add react-native --exact failed.

报错,这如何解决???什么情况。。。代理没问题。网络没问题。

解决方案

是网络问题~

扫一扫关注IT屋

微信公众号搜索 “ IT屋 ” ,选择关注与百万开发者在一起

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值