0

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.

1
  • have you actually installed the package? Commented Mar 23, 2021 at 18:48

1 Answer 1

1

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
Sign up to request clarification or add additional context in comments.

1 Comment

this is assuming you use npm - if you're using yarn do $ yarn install. Also, hopefully it is clear that the command should be run from the root project directory where package.json is present

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.