Reactjs Project installation issue - reactjs

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

Related

web reactjs vs .net core Error Module not found: Can't resolve 'assets

enter image description here
I tried:
npm uninstall node-sass
npm install node-sass#4.14.1
npm install -g sass
npm install --save-dev sass
But it doesn't work, please help me!

React App Suddenly Failing To Compile - scss unable to import

App was compiling last night when running npm start. This morning it's throwing this error:
Failed to Compile
./src/components/HamButton/styles.scss (./node_modules/css-loader??ref--6-oneOf-5-1!./node_modules/postcss-loader/src??postcss!./node_modules/sass-loader/lib/loader.js??ref--6-oneOf-5-3!./src/components/HamButton/styles.scss)
To import Sass files, you first need to install node-sass.
Run `npm install node-sass` or `yarn add node-sass` inside your workspace.
Running npm install node-sass didn't fix it.
If I comment out all scss imports, app will compile however styles are not applied.
What's causing this and how can I fix it?
Thanks
Node v10.15.3
npm v6.4.1
Apparently my npm install was corrupt so followed these steps: On npm install: Unhandled rejection Error: EACCES: permission denied
Then installed node-sass and it worked.

npm ERR! code ENOSELF while installing react dependencies

when I try to install dependencies using 'npm install react react-dom prop-types --save-dev' to the react (in webstorm) it shows an error 'npm ERR! code ENOSELF'.
it did work correctly before so i tried 2 3 times creating new projects
npm install react react-dom prop-types --save-dev
npm install react react-dom prop-types --save-dev should install all the dependencies but it shows an error
For this error,
make sure that the project name and package name should not be the same.
or just rename the package name property in my package.json in the branch...
rename your project directory to something else....
then execute below command
npm audit fix
or
npm audit fix --force

Reactjs project creating while react-dev-utils not found

I had created reactjs project first I had installed globally create react app
npm install -g create-react-app
next, I try to project creation. am using this command
create-react-app react-firebase
while installing i had faced npm ERR! 404 Not Found: react-dev-utils#^5.0.2
error:
npm ERR! code E404
npm ERR! 404 Not Found: react-dev-utils#^5.0.2
How to fix it...
i tried this yarn add -g react-dev-utils#https://registry.npmjs.org/react-dev-utils/react-dev-utils-5.0.2.tgz (remove the "/-/" from the URL) and then run create-react-app my-app and it worked.
or if using npm try:
npm install -g react-dev-utils#https://registry.npmjs.org/react-dev-utils/react-dev-utils-5.0.2.tgz
The problem is npm is not able to find react-dev-utils in the registry server.
you can try different registries as mentioned here
Can't install any packages in Node.js using "npm install"
then you can solve this installing that package
npm install react-dev-utils#^5.0.2 -g
Something has changed in the registries. Explicitly adding the package didn't work for me, but flushing the lock files to remove reference to the old registry path did:
Yarn:
Delete yarn.lock
Run yarn
NPM:
Delete package-lock.json
Run npm install

executing create-react-app gives an error

I get the following error when I run create-react-app my-new-app. My npm version is 6.1.0 and node version is 8.11.3
$ create-react-app my-new-app
Creating a new React app in C:\Users\home\Desktop\Web Development\7.
React\my-new-app.
Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts...
npm ERR! Unexpected end of JSON input while parsing near '...ectories":
{},"dist"
:{'
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\home\AppData\Roaming\npm-cache\_logs\2018-06-
16T12_46_38_1
22Z-debug.log
Aborting installation.
npm install --save --save-exact --loglevel error react react-dom react-
scripts
has failed.
Deleting generated file... package.json
Deleting my-new-app / from C:\Users\home\Desktop\Web Development\7. React
Done.
Try the below command:
npm cache clean --force
Maybe you have an outdated create-react-app version.
If you have npm 6, then you also have npx. Using npx you can just do:
npx create-react-app my-new-app
And it will use the latest create-react-app, even if you don't have it installed.
Check the documentation

Resources