已完成加载依赖关系图。
错误:捆绑失败:错误:无法解析interface TreeModel {
id: number;
parent: number;
value: string;
children?: Array<TreeModel>;
}
const oData : TreeModel[] = [
{ id: 1, parent: 5, value: 'Apple' },
{ id: 2, parent: 7, value: 'Carrot' },
{ id: 3, parent: 10, value: 'Lettuce' },
{ id: 4, parent: 5, value: 'Orange' },
{ id: 5, parent: 0, value: 'Fruit' },
{ id: 6, parent: 0, value: 'Condiments' },
{ id: 7, parent: 0, value: 'Vegetables' },
{ id: 8, parent: 6, value: 'Salt' },
{ id: 9, parent: 6, value: 'Pepper' },
{ id: 10, parent: 7, value: 'Green Vegetables' }
]
const build = (pid) => {
oData.filter(d => d.parent === pid).forEach(d => {
d.children = oData.filter(c => c.parent === d.id);
build(d.id);
if (d.children.length > 0) {
oData = oData.filter(c => c.parent !== d.id);
d.children.forEach(c => build(c.id));
} else {
delete d.children;
}
});
}
build(0);
console.log(JSON.stringify(oData));
中的模块AccessibilityInfo
:急速模块映射中不存在模块E:\react-apps\Whatsapp\node_modules\react-native\Libraries\react-native\react-native-implementation.js
答案 0 :(得分:0)
由于您具有本机版本“ 0.44.0”,并具有版本“ 16.3.1”,因此根据文档,您必须具有正确的版本依赖性。请升级您的本机版本。
请参考此链接以获取更多详细信息https://github.com/react-community/create-react-native-app/blob/master/VERSIONS.md
从项目中删除node_modules文件夹。还可以使用以下命令:
npm prune
npm cache clear
npm cache clean --force
npm start -- --reset-cache
npm i