While run the React application getting error - reactjs

You need to install 'webpack-dev-server' for running 'webpack serve'.
Error: Cannot find module 'ajv/dist/compile/codegen'
I getting error like this when give npm install to run React application. Please give solution to solve this issue.

I had the same issue when I used JHipster, which I solved by running this command
npm install --save-dev ajv#^7
Thanks to this answer

Related

You need to install 'webpack-dev-server' for running 'webpack serve'. - error getting when give npm start in React Application

[webpack-cli] You need to install 'webpack-dev-server' for running 'webpack serve'.
Error: Cannot find module 'ajv/dist/compile/codegen'
I getting error like this when give npm start in React Application.
Have you checked in your package.json to see if it has been installed? It is common to mispell something on install and have a different package installed. Here is a similar thread
webpack-dev-server isn't working in my project

React JS "npm start" shows failed to complile web-vitals

failed to compile -/src/reportWebVitals.js Module not found: Can't resolve 'web-vitals'.
Since new to react JS, could not find what happened. Here is the reportWebVitals.JS file. Thanks in advance for the help.
"/src/reportWebVitals.js Module not found: Can't resolve 'web-vitals' in 'E:\ReactResources\RectProjects\test-app\src'"`
In your Terminal stop the server (Ctrl+C) and run the following command:
npm i web-vitals --save-dev
Manually installing web-vitals worked for me.
I used the following command
yarn add web-vitals

I am having an error while installing Create-react-app

I want to get started with React.js and I am following their official documentation that states to use - npx create-react-app my-app to install the app, but I am getting the error below every time. Please help
You can try the following ways to resolve the error -
Delete everything from C:\Users\your_pc_name\AppData\Roaming\npm-cache
This could be a local caching issue. Try the command npm cache clean --force using administrator mode in your terminal and then try again with the same command - npx create-react-app my-app.
If the above command doesn't work, try the same command or another similiar command - npm cache clear --force and then npm install after that. After this, you can run the commands to setup your react project and see if it works.
These were the point I have referred online from people who faced a similar issue. Try to see if any of the above steps resolve your issue.
I have aggregated the working solutions but if this still doesn't solve your problem, you could refer the links mentioning a similar problem -
https://github.com/facebook/create-react-app/issues/7261
Installing create-react-app gives npm ERR! shasum check failed and npm ERR! Unexpected end of JSON input while parsing near '...mojOzGIEI2rg0m24Yb5Oq'
NPM Install Error:Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'
Error installing reactjs: Error unexpected end of JSON input while parsing near

Webpack-hot-middleware/client module not found

So im getting this error in the terminal ERROR in multi ./client/src/index.js webpack-hot-middleware/client
Module not found
I am not sure why because in my project this file is there. I tried the npm install --save command but that didn't change anything. Any help appreciated
Try this steps
npm cache clean
npm i webpack-hot-middleware --save-dev

Creating the react app issue with npm

I tried creating the new react app and for that i have followed the reactjs command to install like npm install -g create-react-app. But its not working and i am getting the error as npm ERR! Cannot find module 'pseudomap'. So for that i have uninstalled the nodejs 3 times and installed freshly. But still no luck for me. Can anybody provide any solution for this.
See below screens:

Resources