简体   繁体   中英

RN None of these files exist: * aws-exports

I initialized a new react native project with Amplify.

npm install -g @aws-amplify/cli
amplify configure
npm install -g expo-cli 
expo init RNAmplify
cd RNAmplify
amplify init
npm install aws-amplify aws-amplify-react-native @react-native-community/netinfo @react-native-async-storage/async-storage
import Amplify from 'aws-amplify'
import config from './aws-exports'
Amplify.configure(config)

And I keep getting this response when I reload the app. The aws-amplify, aws-amplify-react-native are present in the node_modules directory.

Unable to resolve module ./aws-exports from C:\Users\Masi\IdeaProjects\RNAmplify\App.js: 

None of these files exist:
  * aws-exports(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)
  * aws-exports\index(.native|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx|.android.js|.native.js|.js|.android.jsx|.native.jsx|.jsx|.android.json|.native.json|.json)

查看文件夹“src”

What helped me was that I actually needed to run amplify init which creates an amplify folder for you after you answer a few questions.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM