Webpack-hot-middleware/client module not found - reactjs

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

Related

While run the React application getting error

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

React.Js styled-components getting this error

ERROR in ./src/components/Login.js 4:0-39
Module not found: Error: Cannot find file:
'styled-components.browser.esm.js' does not match the corresponding
name on disk:
'.\node_modules\styled-Components\dist\styled-components'.
This looks like an installation problem. Run/type in command line
npm install --save styled-components
and then restart your app, by running npm start
If you use yarn, replace npm with yarn.
Let us know if the issue resolves!

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

Reactjs Project installation issue

I have cloned a react js project from Github to my local,
After giving 'npm start' i am getting the below error
./src/index.js
Module not found: Can't resolve '#material-ui/core/styles' in 'C:\Users\Goodwork\desktop\xxxxxxxxxxx\src'
After cloning do npm install to download dependencies. run below command.
npm install
then run project
npm start
NOTE: if your package.json don't have #material-ui/core in dependencies list then you may have to install it.
run this command.
npm install #material-ui/core

npm error: 'specify configs in the ini-formatted file:' \User\.npmrc

NOOB here, trying to follow this React tutorial: https://github.com/reactjs/react-tutorial/
The README.md file says to:
npm install
node server.js
After cloning the repo, I ran npm install and a bunch of stuff (modules?) downloaded. But when I try to run npm server.js and I'm hit with this message:
Specify configs in the ini-formatted file:
C:\Users\User\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm#3.3.6 C:\Program Files\nodejs\node_modules\npm
C:\Users\User\.npmrc contains this:
key=
Any ideas on how to get the npm server up and running? Do I need to set the key in this file to something?
the correct way to start the server would be
npm run server.js
Try out below command if trying to start NextJS react
npm run-script start
Use npx instead of npm:
npx create-react-app my-app
try like below command without npm
Ex: create-react-app app-name .(without npm)
Steps worked for me
Create a folder ".npmrc" under the path it is complaining
Set the cache location using command npm config set cache 'path to npmrc folder' --global
Try running npm install package now
It should be with a space:
npm install #angular/material --save
If you are using Angular 2+:
Check the content of the file package.json into "scripts", as image below
Then you would use in terminal:
npm run ng or
npm run start etc.
In my case I was executing without run and becase of this I got the same error as you.
Now, using runis ok!

Resources