2017-09-24 70 views
0

我按照this lesson反應本地運行IOS不工作

Versions are: 
    npm 5.4.2 
    homebrew 1.3.3 
    react-native-cli: 2.0.1 
    react-native: 0.48.4 
    watchman 4.9.0 
    node v6.6.0 

過程中我已經跑了命令:

[email protected]  ~/Documents/ReactNativeLearning  react-native init albums 
This will walk you through creating a new React Native project in /Users/admin/Documents/ReactNativeLearning/albums 
Using yarn v1.0.2 
Installing react-native... 
yarn add v1.0.2 
info No lockfile found. 
[1/4] Resolving packages... 
warning [email protected]: connect 2.x series is deprecated 
[2/4] Fetching packages... 
[3/4] Linking dependencies... 
warning "[email protected]" has unmet peer dependency "[email protected]". 
[4/4] Building fresh packages... 
success Saved lockfile. 
success Saved 496 new dependencies. 

✨ Done in 25.56s. 
dyld: lazy symbol binding failed: Symbol not found: _node_module_register 
    Referenced from: /Users/admin/node_modules/bufferutil/build/Release/bufferutil.node 
    Expected in: flat namespace 

dyld: Symbol not found: _node_module_register 
    Referenced from: /Users/admin/node_modules/bufferutil/build/Release/bufferutil.node 
    Expected in: flat namespace 

[1] 12606 abort  react-native init albums 
✘ [email protected]  ~/Documents/ReactNativeLearning  react-native run-ios 
Command `run-ios` unrecognized. Make sure that you have run `npm install` and that you are inside a react-native project. 
✘ [email protected]  ~/Documents/ReactNativeLearning  cd albums 
[email protected]  ~/Documents/ReactNativeLearning/albums  react-native run-ios 
dyld: lazy symbol binding failed: Symbol not found: _node_module_register 
    Referenced from: /Users/admin/node_modules/bufferutil/build/Release/bufferutil.node 
    Expected in: flat namespace 

dyld: Symbol not found: _node_module_register 
    Referenced from: /Users/admin/node_modules/bufferutil/build/Release/bufferutil.node 
    Expected in: flat namespace 

[1] 12632 abort  react-native run-ios 

回答

0

嘗試做在你的項目文件夾中的npm install然後做react-native run-ios

+0

試了一下檢查了這一點:https://gist.githubusercontent.com/anonymous/6ab41a6fc3499030fcf228ef34317c35/raw/8628a9bb7e27f053ce0398dabb99e49e1dc16db7/gistfile1.txt –

+0

這是你第一次使用初始化反應本地CLI兄弟的一個項目? –

+0

如果這是第一次,可能'''react-native''' cli安裝不正確。嘗試卸載,然後再次安裝cli。 –

0

我得到它的工作原來,我使用的是不同版本的節點(v6.6.0)。所以我安裝了nvm,並升級了我的節點。現在它工作了!

另外我嘗試使用create-react-native-app而不是react-native init。出現了同樣的問題。一定要更新所有必要的工具並檢查您的節點版本。