installed latest vue/cli and created project using vue2.
After this, I added vuetify and thats all for additional to basic vue2 template list of packages.
When I have tryed to use 'npm install'
Found: #vue/cli-service#undefined
npm ERR! node_modules/#vue/cli-service
npm ERR! dev #vue/cli-service#"5.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #vue/cli-service#"^3.0.0 || ^4.0.0 || ^5.0.0-0" from #vue/cli-plugin-babel#5.0.0
npm ERR! node_modules/#vue/cli-plugin-babel
npm ERR! dev #vue/cli-plugin-babel#"5.0.0" from the root project`
can you guys explain me meaning of error
myVersions
As you are seemingly on an old version of npm (<=6.x) you need to install the peer dependency yourself:
npm i -D #vue/cli-service#5.0.0
After installing the dependency, edit your package.json and insert this block on the top level, right after the "devDependencies" object:
"peerDependencies": {
"#vue/cli-service": "^5.0.0"
}
and remove that dependency from the "devDependencies" object.
If you don't want to deal with peer dependencies yourself, upgrade your node and npm version. To upgrade npm only:
npm i -g npm
Despite the fact that I reconfigured entire project. I will anyway answer this question.
Issue was related to cli-service 5.0.0, when I should have had 5.0.8 in order to use babel 5.0.0.
I want to add that if you use default vue.2 template with vue/cli 5.0.8,
You will get another error after installing vuetify, which was not able to fix.
Error is related to vuetify loader.
I fixed it with start up new project and manually inserting all dependencies compatible with vuetify-loader 1.5
Because 1.7 brakes npm run serve
Related
I am trying to install material UI as described on the home page, but I get a dependency tree error :
C:\dev\shape-shop-front-end>npm install #mui/material
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-app#0.1.0
npm ERR! Found: react#16.14.0
npm ERR! node_modules/react
npm ERR! react#"^16.13.1" from the root project
npm ERR! peer react#">=16.8.0" from #emotion/react#11.7.1
npm ERR! node_modules/#emotion/react
npm ERR! node_modules/#mui/material
npm ERR! #mui/material#"*" from the root project
npm ERR!
In my package.json I have "react": "^16.13.1" .
As I understand it, this error is saying that a MUI package needs react 16.8.0
Indeed, a sub-dependency of it, named #emotion/react#11.7.1, has listed the following peer dependencies you have to meet:
"peerDependencies": {
"#babel/core": "^7.0.0",
"react": ">=16.8.0"
}
source: https://github.com/emotion-js/emotion/blob/main/packages/react/package.json
I think this has to do with how new versions of NPM deal with peer dependencies: https://github.blog/2021-02-02-npm-7-is-now-generally-available/
As your react version seems OK, I would go with this suggestion:
You have the option to retry with --force to bypass the conflict or --legacy-peer-deps command to ignore peer dependencies entirely (this behavior is similar to versions 4-6).
Try using --force.
That's what worked for me
npm install #mui/material --force
I have a feeling it's a dependency conflict that came with the recent React upgrade...
Looks like updating dependencies in package.json is the only way to make this happen now.
$ npm install -g npm-check-updates
$ ncu -u
$ npm install
or see how to update each dependency in package.json
after updating, now try to install your material UI.
use this command instead
npm install #material-ui/core
If you're using it for the icon, then use this
npm install #material-ui/core #material-ui/icons
Try using
npm install #material-ui/core --force
I tried to install #material-ui/core librabry but then npm throws the error below
I used the
npm install #material-ui
command
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: school-demo#0.1.0
npm ERR! Found: react#17.0.1
npm ERR! node_modules/react
npm ERR! react#"^17.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react#"^16.8.0" from #material-ui/core#4.11.0
npm ERR! node_modules/#material-ui/core
npm ERR! #material-ui/core#"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/freduah/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /home/freduah/.npm/_logs/2020-11-02T14_50_03_045Z-debug.log
freduah#freduah:~/school-demo$ ```
MaterialUI 4 doesn't support React 17 yet. Please check the issue created on github https://github.com/mui-org/material-ui/issues/23306.
You can try to install it by force by adding '-f':
npm install -f #material-ui/core
I had come across the same problem. These worked for me:
For core: npm -f install #material-ui/core
For icons: npm -f install #material-ui/icons
you can downgrade your react, it worked for me by this command:(I downgrade from v17)
npm install --save react#16.13.0 react-dom#16.13.0
Material UI is using emotion as a styling engine by default. If you want to use styled-components instead, run:
try to use this
npm install #mui/material #mui/styled-engine-sc styled-components
i highly recommend to read the document in thar website and not from npm
npm install #mui/material #emotion/react #emotion/styled
worked for me. Which I found on https://mui.com/
check your react versian, MaterialUI 4 doesn't support React 17. you can change youre version by
npm install --save react#16.13.0 react-dom#16.13.0
make sure 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.
Try
yarn add #material-ui/core & yarn add #material-ui/core
React 17 dont support material UI install previous versions or use yarn It will take some time but work perfectly fine
This worked for me
npm install -force #material-ui/core
Problem: npm install #material-ui/core
Solution:
npm install #mui/material #emotion/react #emotion/styled
OR
yarn add #mui/material #emotion/react #emotion/styled
npm install -f #material-ui/core
or
npm install #mui/material #emotion/react #emotion/styled --legacy-peer-deps
or You can downgrade react
npm install --save react#16.13.0 react-dom#16.13.0
I've inherited a react/node/prismic application that uses shrinkwrap, and we need to update the prismic-reactjs package. That package requires higher versions of react and webpack, so I updated those in package.json too, and based on some npm dependency reading I've been roughly following these steps:
rm -fr node_modules
npm uninstall [package_name]
npm prune
npm cache clean
npm install [package_name]
npm shrinkwrap (to check missing dependencies)
npm install
npm shrinkwrap
That last shrinkwrap step shows the remaining "npm ERR! peer invalid:" statements, so I've been working my way top to the bottom of the list, and I'm now down to only three of them:
npm ERR! peer invalid: webpack#^3.1.0, required by extract-text-webpack-plugin#3.0.2
npm ERR! peer invalid: react#^15.6.1, required by react-dom#15.6.1
npm ERR! peer invalid: react#^15, required by react-router-dom#4.1.2
Uh oh- it looks like those peer dependencies need the older versions I'd had for webpack (I updated 3.12.0 -> 4.0.0) and react (I updated 15.6.1 -> 16.0.0).
Of those 3 other packages, one is deprecated so I can't upgrade it if I tried. I could try updating the other 2, but I'm not sure if this is yak shaving- is there a better way forward? Is it possible to have both/conflicting packages in use?
I created my project using angular 6 but due to some reasons i want to rollback to angular 5,I tried following commands but it is showing some errors.
node version- 10.4.1
npm version-6.1.0
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #angular/cli#1.7.
npm ERR! notarget In most cases you or one of your dependencies are
requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\TEKIZMA USER\AppData\Roaming\npm-cache\_logs\2018-06-
27T0
_21_53_446Z-debug.log
Please try to follow this Stack Answer
According to my knowledge first, try to downgrade NPM then angular.
And you might need to read this too.
Try possibly this way
npm install -g #angular/cli#YOUR_DESIRED_VERSION
You do not need to reinstall global version of Angular CLI.
Instead, you can use NPX library like:
npx -p #angular/cli#<version> new <app-name>
I am having problems installing an npm package that has a file dependency off of github. When installing directly from a local package there are no problems.
The package that I am trying to install has a dependency on a package defined within on of its subdirectories.
The error I am getting is as follows:
npm ERR! code ENOLOCAL
npm ERR! Could not install from "node_modules/local-dependency-example/local-dependency" as it does not contain a package.json file.
I created the following package in order to reproduce: https://github.com/eladzlot/local-dependency-example
In order to reproduce you should create an empty package: npm init.
Then attempt to install: npm install eladzlot/local-dependency-example --save.
This problem occurs both with npm v3.10.10 and npm v5.5.1