9 reactjs react-native react-native-android react-native-cli metro-bundler
我按照以下链接开始使用react-native
我试图创建没有expo的本机应用程序,所以按照文档,我遵循以下命令
npm install -g react-native-cli
react-native init AwesomeProject
Run Code Online (Sandbox Code Playgroud)
运行android命令后
react-native run-android
Run Code Online (Sandbox Code Playgroud)
它给我以下模拟器错误
所以我用启动命令来运行Metro服务器
react-native start
Run Code Online (Sandbox Code Playgroud)
这个命令给了我控制台另一个错误
Jav*_* C. 56
使用某些 NPM 和 Node 版本的 Metro 存在问题。
你有两种选择:
\node_modules\metro-config\src\defaults\blacklist.js
并更改以下代码:var sharedBlacklist = [
/node_modules[/\\]react[/\\]dist[/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
Run Code Online (Sandbox Code Playgroud)
对此:
var sharedBlacklist = [
/node_modules[\/\\]react[\/\\]dist[\/\\].*/,
/website\/node_modules\/.*/,
/heapCapture\/bundle\.js/,
/.*\/__tests__\/.*/
];
Run Code Online (Sandbox Code Playgroud)
请注意,如果您运行
npm install
或yarn install
您需要再次更改代码。
归档时间: |
|
查看次数: |
3555 次 |
最近记录: |