Module build failed (from C:/Users/User/notes-app-api/node_modules/eslint-loader/index.js): Error: Failed to load plugin react: Cannot find module 'eslint-plugin-react'

I think everything is explained below.

C:\Users\User\notes-app-api>serverless invoke local --function create --path mocks/create-event.json
Serverless: DOTENV: Loading environment variables from .env:
Serverless:      - tableName
Serverless: Bundling with Webpack...

ERROR in C:/Users/User/notes-app-api/create.js
Module build failed (from C:/Users/User/notes-app-api/node_modules/eslint-loader/index.js):
Error: Failed to load plugin react: Cannot find module 'eslint-plugin-react'
........

  Your Environment Information ---------------------------
     Operating System:          win32
     Node Version:              10.13.0
     Framework Version:         1.61.3
     Plugin Version:            3.3.0
     SDK Version:               2.3.0
     Components Core Version:   1.1.2
     Components CLI Version:    1.4.0

Solved the issue by installing eslint like this:

C:\Users\User\notes-app-api>npm install eslint --save-dev
1 Like

That’s weird that you had to do that. Was this from a fresh install?

I had the same issue. It was from a fresh install.

Weird. How did you fix it?

I was just replying to your question that it was from a fresh install. The original post about manually adding eslint to the problem is the solution

1 Like