我碰到下面的錯誤在我的iPhone模擬器陣營本地模塊沒有找到
Unable to resolve module react-native from/Users/myname/source/sandbox/auth/src/components/LoginForm.js: Module does not exist in the module map or in these directories:
/Users/myname/source/sandbox/auth/node_modules
我繼續遵循明確的守望方向的規定。關閉我的終端,重新啓動我的電腦。
我研究了這裏和其他來源。找到一個解決方法來安裝舊版本的Firebase。我安裝了[email protected]出現了同樣的錯誤。
這裏是我的應用程序組件
import React, { Component } from 'react';
import { View } from 'react-native';
import firebase from 'firebase';
import { Header } from './components/common';
import { LoginForm } from './components/LoginForm';
class App extends Component {
componentWillMount() {
firebase.initializeApp({
apiKey: "myApiKey",
authDomain: "myDomain",
databaseURL: "myURL",
storageBucket: "myStorageBucket",
messagingSenderId: "myMessengerID"
});
}
render() {
return (
<View>
<Header headerText="Authentication" />
<LoginForm />
</View>
);
}
}
export default App;
LoginForm的組件
import React, { Component } from 'react';
import { View } from 'react-natvie';
import { Button, Card, CardSection } from './common';
class LoginForm extends Component {
render() {
return (
<Card>
<CardSection />
<CardSection />
<CardSection>
<Button>
Log In
</Button>
</CardSection>
</Card>
);
}
}
export default LoginForm;
任何幫助,將不勝感激!
我不明白這與firebase有什麼關係。您是否正確設置了您的react-native項目? 'node_modules/react-native'文件夾是否存在? – Eldelshell
是的,我確實有node_modules/react-native文件夾 – ryanb082
哦,問題出在'LoginForm'模塊,向我們展示了代碼。 – Eldelshell