while using npm start it shows failed to compile can't resolve - reactjs

Failed to compile
./node_modules/jest-serializer/build/index.js
Module not found: Can't resolve 'v8' in 'C:\Users\Desktop\reactapp\react-project\node_modules\jest-serializer\build'
This error occurred during the build time and cannot be dismissed.

Try below steps :
1.Remove package-lock.json file.
2.Run npm install command.
3.Try to execute npm start again.

Related

Working on a PR for DefinitelyTyped. How can I fix "Cannot find module 'csstype'" when I create pull request to DefinitelyTyped"?

I am currently working on a PR to definitelyTyped.
https://github.com/0529bill/DefinitelyTyped This is my repo.
I've followed the contributing steps on definitelyTyped, but every test runs without error(npm run lint, npm lint redux-persist-expire, npm run-all)on local, but when I make PR, the CI's run-all test failed and showed below's error
../react/index.d.ts(38,22): error TS2307: Cannot find module 'csstype' or its corresponding type declarations.
this is the error code that I received. I've tried to
cd types/redux-persist-expire && npm i;
cd types/react && npm i
npm install --prefix /home/runner/work/DefinitelyTyped/DefinitelyTyped/types/react
which return error npm ERR! ENOTSUP: operation not supported on socket, mkdir '/home/runner'
any idea how can I solve this problem?

When run npm start , the following error shows: can not find module in "..../node_modules/html-webpack-plugin/lib/loader.js'

When run npm start, the following error shows: can not find module in "..../node_modules/html-webpack-plugin/lib/loader.js', didn't change any code after "npx create-react-app".
may be you can try delete node_modules and package-lock.json then npm install or yarn again

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

npm always returns this error "Unexpected end of JSON input while parsing near '...0.4.2":{"name":"comma' "

I want to publish my site via netlify so I have to install netlify-cli globally but am getting this error.
The error that occurred
Try this:
npm cache clean --force
npm install -g netlify-cli

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

Resources