Not able to install #mui/icons-material
When I try to install material ui icons dependency it got stuck for a long time showing like this:
# client**>npm install #mui/icons-material
[##############....] \ reify:fsevents: sill reify mark deleted [
I also cleared the cache using npm cache clean --force but it didn't work.
How can I come out of this problem?
Install Material UI core
npm install #mui/material #emotion/react #emotion/styled
After installing it install the icons package by running
npm install #mui/icons-material
If you have material-ui/core v4 upgrade it to the latest one and for that, you also need to update react to at least v17 because the minimum requirement for v5 of material-ui is v5.
How can I downgrade my React version from 17 to 16 as many of the React packages are not supported by React 17?
Assuming you're using npm/yarn or another node package manager, dependency versions are listed in package.json.
Search for the react and react-dom packages under dependencies (or devDependencies) and replace their versions with 16.13.0. Then run npm install or yarn or whatever package manager you're using. This should be enough to downgrade to React 16.
If you have packages not compatible with React 16, you might have to downgrade them, too.
After updating dependencies inside package.json you need to run npm install for the changes to take place.
Or if you want to do it all inside of command line you can do it like this:
npm install --save react#16.13.0 react-dom#16.13.0
Source: linasmnew's answer to reactjs - Going back from React 16 to 15 - Stack Overflow
Because I needed redux-devtools as a package on an old project, I had to downgrade from React v17 to React v16. That's what i have done:
npm uninstall react-redux npm uninstall redux
npm install --save react#16.14.0 react-dom#16.14.0
npm install redux npm install react-redux
npm install --save-dev redux-devtools
difference between npm install react-router-dom and npm install --save react-router-dom command
I tried both commands and got same result so can't understand what the actual working difference between these commands
Starting from version 5 npm will save the package to your dependencies by default. For previous versions you needed --save flag to do that.
More info: https://github.com/npm/npm/issues/5108
With the advent of npm v5 or greater, by default, it will be saved without the --save flag.
Prior to npm 5, the --save command will also save the package name under the package.json file under the dependencies object.
This will ensure than if this project was to be pulled/cloned on a different computer, you can type npm install to install all the dependencies listed under the package.json.
Whereas without --save, the dependency will not be put into package.json dependencies list. And when you type npm install in a new environment, you will be missing that package.
I have an existing project, which has react#15 and all it's dependencies according to that. But now I have to upgrade to react#16 along with it's dependencies. Now, the problem is - there are a lot of dependencies and it is very time consuming to identify version of each dependency.
So, I was wondering if there was a way where I could upgrade the versions of React and it's dependencies mentioned in package.json, without manually modifying the package.json file.
Using npm
Latest version while still respecting the semver in your package.json: npm update <package-name>.
So, if your package.json says "react": "^15.0.0" and you run npm update react your package.json will now say "react": "^15.6.2" (the currently latest version of react 15).
But since you want to go from react 15 to react 16, that won't do.
Latest version regardless of your semver: npm install --save react#latest.
If you want a specific version, you run npm install --save react#<version> e.g. npm install --save react#16.0.0.
https://docs.npmjs.com/cli/install
Using yarn
Latest version while still respecting the semver in your package.json: yarn upgrade react.
Latest version regardless of your semver: yarn upgrade react#latest.
https://yarnpkg.com/lang/en/docs/cli/upgrade/
if you want to update your react and react-dom version in your existing react step then run this command I hope You get the latest version of react and react-dom.
Thanks
npm install react#latest react-dom#latest
I found a nice article here.
All we need to do (for npm, globally) is:
sudo npm install -g npm-check-updates
Then run it like below:
ncu -u
It will show you all dependencies (upgraded) nicely like below:
Upgrading /home/ajay/Documents/react-beast/package.json
[====================] 7/7 100%
#testing-library/user-event ^11.4.2 → ^13.0.16
react ^17.0.1 → ^17.0.2
react-dom ^17.0.1 → ^17.0.2
react-scripts 4.0.1 → 4.0.3
web-vitals ^1.1.0 → ^1.1.1
Try running ncu -u again immediately after above and you will a message like this:
Upgrading /home/ajay/Documents/react-beast/package.json
[====================] 7/7 100%
All dependencies match the latest package versions :)
Do a npm install after that and you should have all the latest versions for all your dependencies for your project.
To me this was the nicest and cleanest solution (well - in most cases) if we need to keep our (npm/React) project - latest and greatest - rather than wasting time on manually updating the versions.
I highly recommend using yarn upgrade-interactive to update React, or any Node project for that matter. It lists your packages, current version, the latest version, an indication of a Minor, Major, or Patch update compared to what you have, plus a link to the respective project.
You run it with yarn upgrade-interactive --latest, check out release notes if you want, go down the list with your arrow keys, choose which packages you want to upgrade by selecting with the space bar, and hit Enter to complete.
Npm-upgrade is ok but not as slick.
Some packages are interdependent and are to be used with the same versions of each other... for example recently had a problem with npm react#16.5.2 and react-dom#16.5.2. I wanted to use a hook but could not so I ran:
npm update react#latest react-dom#latest
this did not work... went into some of the react.js blogs/documentation and found that these particular packages are interdependent and the versions must be the same. To update these:
npm uninstall react
npm uninstall react-dom
npm install react#^16.8.0 react-dom#^16.8.0
And everything worked just fine. Look for stable releases. Read the documentation.
https://reactjs.org/blog/2019/02/06/react-v16.8.0.html
https://reactjs.org/warnings/invalid-hook-call-warning.html
Yes, you can use Yarn or NPM to edit your package.json.
yarn upgrade [package | package#tag | package#version | #scope/]... [--ignore-engines] [--pattern]
Something like:
yarn upgrade react#^16.0.0
Then I'd see what warns or errors out and then run yarn upgrade [package]. No need to edit the file manually. Can do everything from the CLI.
Or just run yarn upgrade to update all packages to latest, probably a bad idea for a large project. APIs may change, things may break.
Alternatively, with NPM run npm outdated to see what packages will be affected. Then
npm update
https://yarnpkg.com/lang/en/docs/cli/upgrade/
https://docs.npmjs.com/getting-started/updating-local-packages
If you want to update react use npx update react on the terminal.
If you want to update any specific version from the package.json you can update the version of the package by doing ==>
yarn add package-name#version-number
or
npm install --save package-name#version-number
If you want to update all packages to the latest version you can run command ==>
npm audit fix --force
you can update all of the dependencies to their latest version by
npm update
You can just use this command
npm install -g create-react-app
if you don't have root user permissions then use this with
sudo npm install -g create-react-app
👇️ with NPM
npm install react#latest react-dom#latest
👇️ only if you use TypeScript
npm install --save-dev #types/react#latest #types/react-dom#latest
------------------------------
👇️ with YARN
yarn add react#latest react-dom#latest
👇️ only if you use TypeScript
yarn add #types/react#latest #types/react-dom#latest --dev
Use this command to update react npm install --save react#16.12.0
Don't forget to change 16.12.0 to the latest version or the version you need to setup.
No need to install react, just do the following command in terminal in Linux/Mac or cmd in Windows:
npx create-react-app my-app
my-app - is a optional name, you may name it whatever you want it to.
It would create the updated template for your next project up and ready!
In terminal run the commands to update the react versions
$npm i react#next react-dom#next
Config: macOS High Sierra, version 10.13.2, node:v8.1.2 npm:5.0.3
When I run npm start in my angularjs project I get this error:
ERROR in Cannot find module 'node-sass'
After this I run:
npm i node-sass
Now I get this error:
gyp: No Xcode or CLT version detected!
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
Why won't npm install node-sass? How can I install node-sass?
Here's the solution:
sudo npm install --save-dev --unsafe-perm node-sass
Enjoy!
Edited to explain the options (from comments):
--save-dev is used so that your app is able to find the module in local node_modules. --save-dev adds package to devDependencies in package.json. --unsafe--perm is used to run install scripts as root. To avoid sudo, use nvm instead. --unsafe--perm is really not needed as sudo is already mentioned. So the command basically air tights the script to install node-sass at any cost.
This error is for node-sass is not present ... to solve this just you want to run following command
npm install node-sass
According to node-sass github page, supported node.js version vary release by release.
https://github.com/sass/node-sass
Example:
Check the version of node you are running.
node -v
-> v12.0.0
you need node-sass v4.12+. so you can
npm install node-sass#4.12.0
or if 4.12.0 is the latest
npm install node-sass#latest
(npm install node-sass will install the latest version in many cases, but remember that it does not always install the latest(in this example 4.12.0) if dependency in package.json is written like ^3.0.0, ~4.11.0)
What's the difference between tilde(~) and caret(^) in package.json?
Lastly, using sudo with npm is not a good practice. Please refer to this article.
https://medium.com/#ExplosionPills/dont-use-sudo-with-npm-still-66e609f5f92
Doing npm uninstall node-sass and then npm i node-sass did not work for me.
Solution worked for me is npm install --save-dev node-sass.
Happy Coding..
Run:
npm rebuild node-sass --force
and it'll work fine.
It worked for me...
sudo npm rebuild node-sass --force
node-sass is not being installed and it can be one of many reasons
You have not installed it
npm install node-sass --save-dev
You are having a permissions error
sudo npm install --save-dev --unsafe-perm node-sass
You had a memory issue because it tried to make it (build from c code in your platform),this applies to some platforms and node versions
node --max_old_space_size=8000 $(which npm) install node-sass --save-dev
Your node and npm versions are not compatible,which most probably generated a failure in the build process,
In this case use n or nvm to make sure you have the same version in the new and original environment, the one where it did work, as this is usually by using different versions in different environments
This is what worked for me. I first uninstall node-sass. Then install it back.
npm uninstall node-sass
npm install --save-dev node-sass
It failed for me because I was using the latest version of node (12.7.0) I then had to explicitly install the latest version of node-sass with:
npm install node-sass#4.12.0
I have fix this problem without installing node-sass by this command:
npm install node-sass#4.12.0 --no-save --unsafe-perm
One of the cases is the post-install process fails. Right after node-sass is installed, the post-install script will be executed. It requires Python and a C++ builder for that process.
The log 'gyp: No Xcode or CLT version detected!' maybe because it couldn't find any C++ builder. So try installing Python and any C++ builder then put their directories in environment variables so that npm can find them. (I come from Windows)
I checked the Node version in my local machine, which is v10.11.0.
Then when I checked my development machine, where the error occurred, it had Node version V.10.8.0.
Upgrading Node to v10.11.0 in my development machine fixed the issue.
Hope this helps.
In my case I had to also had to perform:
npm install sass-loader
To fix the problem
There is an issue with downloading npm dependencies due to network which you have. try to download the npm dependencies in open network . you won't get any issue. i am also faced this similar issue and resolved finally.
use below commands: npm install (it will download all depedencies)
npm start to start the angular application
npm install node-sass will do the job in most of the cases, as it will add missing sass npm dependency module doesn't exist or it will overwrite previous crashed version.
For Mac Users use sudo in front of above commands.
On Windows machines npm rebuild node-sass --force may not work for some users because it's essentially saying, "please force npm to rebuild the sass node module for me". It will not work because that module doesn't exist.
Whenever you did npm install to the initial installation, the sass module did not get installed, which is why this problem occurs.
My problem was that a webfilter didn't allow me to download the node-sass package, when I executed the command
npm i
After the installation of the Windows Build Tools
npm i -g windows-build-tools
it build node-sass on it's own and now I can use it.
PS: I also installed Python 2.7.17 before, but I don't think that helped.
Try sudo npm install node-sass#4.12.0 if your node version is 12.
you must install node-sass in dev section of package.json
npm install --unsafe-perm node-sass --save-dev
If you run
npm install node-sass
and it still doesn't work remember to change permission to folder
I have also been facing this error. None of the above methods work for me. Please follow this as it worked for me.
For Installing node-sass in Ubuntu 16 via npm :-
You can install with npm 5.2.0 Version
If you are using nvm :-
nvm install 8.2.1
nvm use 8.2.1
npm install node-sass
If you are using npm separately then upgrade or downgrade npm version to 5.2.0
npm install node-sass
I ran into this error while I was using Microsoft Visual Studio Code's integrated git terminal. For some weird reason VS code was not allowing me to install 'node-sass'. Then I used 'Git Bash' (which was installed with git) and ran the following command:
npm install node-sass
It worked for me. I don't know why & how it worked. If anyone has any explanation please let me know.
You should try to check the log generated by npm install.
I have faced the same issues, and I found the error that python2 is not found in the path (environment variable).
After installing Python, everything worked fine.
I had a similar issue when I tried to run a project.
First i uninstalled the current version
npm uninstall node-sass
Then i reinstalled to the latest version with
npm install node-sass
Upgrading to latest version of nodeJS solved my problem
npm install --save-dev --unsafe-perm node-sass
This will do magic, you can use it with sudo
I had the same error when installing dependencies in Angular. I've tried aforementioned techniques but none of them worked until I've deleted package-lock.json which was previously created when running Node v11.
Now I'm using Node v12 so this is how I got resolved.
I repeat if you have package-lock.json delete it, file and then install dependencies.
Exactly same issue i was also facing and i tried all above answers but could not resolve, Below is the command which fixed my problem.
npm install sass-loader sass webpack --save-dev
https://www.npmjs.com/package/sass-loader
I've fixed this problem by installing v10.16.10 node version.
I met same issue installing node-sass when I am on Node 12.9.0
Once switching to Node 10.19.0, the issue is gone.
Reference: https://github.com/sass/node-sass/issues/2632
There seems to be an issue with the version "node-sass": "4.5.3", try updating to the latest version. Such as you could try adding ^ "node-sass": "^4.5.3" for the latest version