![](/img/trans.png)
[英]Vue and Quasar - Module '“../../node_modules/vue/types”' has no exported member 'defineComponent'
[英]Module '"./node_modules/react-native"' has no exported member 'View'
在我在 typescript 中转换我的项目后,向我显示以下错误模块 '"./node_modules/react-native"' 没有导出的成员 'View'。
import React from 'react';
import {StyleSheet,View,Text} from 'react-native';
export default function App() {
return (
<View style={{ flex: 1 }}>
<Text>Welcome</Text>
</View>
);
}
node_modules
文件夹npm install @types/react @types/react-native
删除node_modules
文件夹并再次运行npm install
或yarn
。
如果不能解决这个问题,尝试运行npm install @types/react @types/react-native
或yarn add @types/react @types/react-native
可能您还应该使用 -D 选项将其安装为开发依赖项,这会将其添加到 devDependencies 列表中。
npm install --save-dev @types/react @types/react-native
(npm install -D @types/react @types/react-native)
或者
yarn add --dev @types/react @types/react-native
(yarn add -D @types/react @types/react-native)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.