Mike Buzaki
Mike Buzaki

Reputation: 35

./src/index.js Module not found: Can't resolve 'aws-amplify' React

I am trying to learn AWS and react. I keep getting the below error for my react app when i run it on my local machine using "NPM start".

./src/index.js Module not found: Can't resolve 'aws-amplify' in 'C:\Users\pull-transactions\src'

at Resolver.resolveModule (node_modules/jest-runtime/node_modules/jest-resolve/build/index.js:306:11) at Object. (src/components/PlaidLink.js:3:1)

index.js config:

import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import Amplify from 'aws-amplify';
import config from './aws-exports';
Amplify.configure(config);

ReactDOM.render(
  <React.StrictMode>
    <App />
  </React.StrictMode>,
  document.getElementById('root')
);

I spent a couple hours searching google but cannot find anything on this. I have another app that is working fine and the file structure looks the same for both. Any help is appreciated. Please let me know if you need more info.

Upvotes: 0

Views: 1100

Answers (1)

Ayushya
Ayushya

Reputation: 389

You must install the package before you can use it.

$ npm install # installs packages listed in your package.json file
$ npm install --save aws-amplify # installs the aws-amplify package and saves it to your package.json file

Upvotes: 1

Related Questions