installed npm and ng - npm

Your global Angular CLI version (15.1.3) is greater than your local version (6.0.8). The local Angular CLI version is used.
To disable this warning use "ng config -g cli.warnings.versionMismatch false".
packageGroup metadata of package #angular/cli is malformed.
packageGroup metadata of package #angular/cli is malformed.
packageGroup metadata of package #angular/cli is malformed. Ignoring.
Package "codelyzer" has an incompatible peer dependency to "#angular/compiler" (requires ">=2.3.1 <13.0.0 || ^12.0.0-next || ^12.1.0-next || ^12.2.0-next", would install "15.1.2")
Package "#angular/http" has an incompatible peer dependency to "rxjs" (requires "^6.0.0", would install "7.8.0")
Package "ts-node" has a missing peer dependency of "#swc/core" # ">=1.2.50".
Package "#angular/http" has an incompatible peer dependency to "rxjs" (requires "^6.0.0", would install "7.8.0").
Package "#angular/http" has an incompatible peer dependency to "#angular/platform-browser" (requires ">=8.0.0-rc.0 <9.0.0||7.2.16", would install "15.1.2").
Package "codelyzer" has an incompatible peer dependency to "#angular/compiler" (requires ">=13.0.0-rc.0 <14.0.0||>=2.3.1 <13.0.0||>=12.0.0-next <13.0.0||>=12.1.0-next <13.0.0||>=12.2.0-next <13.0.0", would install "15.1.2").
Package "codelyzer" has an incompatible peer dependency to "#angular/core" (requires ">=13.0.0-rc.0 <14.0.0||>=2.3.1 <13.0.0||>=12.0.0-next <13.0.0||>=12.1.0-next <13.0.0||>=12.2.0-next <13.0.0", would install "15.1.2").
Package "#angular-devkit/build-angular" has a missing peer dependency of "#angular/localize" # "^15.0.0".
Incompatible peer dependencies found. See above.
i have a problem i installed npm and ng, i want to do an update and i get this error
our global Angular CLI version (15.1.3) is greater than your local version (6.0.8). The local Angular CLI version is used.

Related

NPM: Link peer dependency to package alias

Assume I have legacy codebase working with some old packages:
"mobx": "5.15.4",
"mobx-react": "6.1.8",
While developing some new experimental feature, I wanna use newer versions of these packages, but also have to leave legacy in a working state. So, I'm aliasing newer versions of packages so I can use them alongside with the old ones:
"#new/mobx": "npm:mobx#^6.3.13"
"#new/mobx-react": "npm:mobx-react#^7.2.1"
But mobx-react using mobx as a peer dependency. Obviously, the problem is that #new/mobx-react is watching old mobx version and expectedly says that there should be mobx of version 6+.
Is there any way to manually resolve peer dependency of #new/mobx-react, so it will watch #new/mobx and not just mobx? Or, maybe there is a way to implicitly install peer deps for #new/mobx-react in a way it will not override old mobx version?
You can easily do that
set NODE_ENV=development
npm install mobx#5.15.4 --save
npm install mobx-react#6.1.8 --save
npm install #new/mobx#npm:mobx#^6.3.13 --save
npm install #new/mobx-react#npm:mobx-react#^7.2.1 --save
then you must manually install dependencies for your #new/mobx-react like as follows:
cd ./node_modules/#new/mobx-react
npm install --ignore-scripts
that will lead to mobx of version 6.3.14 be in node_modules of your #new/mobx-react
node.js (starting from npm version 3) at first tries to load dependency from internal node_modules of package, then from node_modules of project see : documentation

Getting an error while "npm install" after deletion of package.lock.json file in the module. [OS - Windows]

I want to delete package-lock.json file in a module and to use npm install. But while npm install running, I got an error saying "unable to resolve dependency tree".
Whole error:
["unable to resolve dependency tree"
while resolving: tpip#0.1.0
Found: react-redux#7.1.0
node_modules/react-redux
react-redux#"7.1.0" from the root project.
could not resolve dependency:
peer react-redux#"^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0" from redux-form-validators#2.7.5
node_module/reduxform-validators
redux-formvalidators #"^2.7.5" from the root project
fix the upstream dependency conflict, or retry
this command with--force, or --legacy-peer-deps
to accept an incorrect (and potentially broken) dependency resolution.
enter image description here
I followed more tutorials and documentations. But I could not solve down it.
There are packages which use some other packages. After npm version 7(my guess), they have added this warning. This is just to inform us about those packages.
To resolve it as it is mentioned use --force
Whole command:
npm install --force
This should solve your issue and the project should work as expected.
You have a package that depended on an older version of redux and you have a newer version.
You should use the command:
npm install --legacy-peer-deps
The --legacy-peer-deps is a way to bypass peerDependency auto-installation, it tells NPM to ignore peer dependencies and proceed with the installation anyway.
Note that this may result in conflicts due to potentially breaking changes

How to resolve yarn warnings

I created a new project with the vue cli.
This project is a Vue3 with Ant Design, Vue Router and Eslint.
However when I give the yarn command it shows me the following warnings.
yarn install v1.22.10
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents#2.3.2: The platform "win32" is incompatible with this module.
info "fsevents#2.3.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents#1.2.13: The platform "win32" is incompatible with this module.
info "fsevents#1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "#vue/eslint-config-airbnb > eslint-import-resolver-webpack#0.13.0" has unmet peer dependency "webpack#>=1.11.0".
warning " > less-loader#7.3.0" has unmet peer dependency "webpack#^4.0.0 || ^5.0.0".
[4/4] Building fresh packages...
Done in 26.91s.
The webpack I noticed is already installed directly on vue 3. How do I resolve these warnings?
for fsevents it seems that it's a MacOS-only library so that might explain why you got the first error.
for peer dependencies and webpack if you are using Yarn it seems that you have to do yarn add webpack --peer or as #kaumadie said in a comment you can also add it directly on the package.json file of your project
With npm, you can do npm i directly in the project's folder and it should resolve all peer dependencies automatically
Hope it helped you, and have a good day !

Missing peer dependencies

I am new to npm and angular projects, and I am using bootstrap#4.1.1 in my package.json. When I do npm install, I get the following error -
bootstrap#4.1.1 requires a peer of jquery#1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
Does this mean that I need to add jquery#1.9.1 - 3 to my package.json under peerDependencies section, apart from installing it locally with no-save option?
Also, do we need to install this missing peer dependency on the build server as well? Or can it be ignored?
Simply install the dependency yourself:
npm install jquery#1.9.1 --save
Although --save is optional I recommend to put it, so the next time you simply can type only npm install and both bootstrap and jquery will be installed. You can read about peer dependencies on npm documentation.
You should read the terminal whether all important dependencies have been installed. If it hasn't install those manually.
npm install <MISSING DEPENDANCY> --save
In your case
npm install jquery#1.9.1 --save
In addition to the given answers:
If npm warns you about a missing dependency with a version range like 1.9.1 - 3 then you should definitely use that range to manually install the dependency – and not only its lower boundary. Use quotes for the range to work as a parameter in the install command. Both of the following examples will work:
npm install jquery#"1.9.1 - 3"
npm install "jquery#1.9.1 - 3"
Also the parameter --save can be omitted as of npm v5.0. This is the default now when you install.

What does ` UNMET PEER DEPENDENCY <packageName> extraneous` mean?

I understand that UNMET PEER DEPENDENCY means I need to npm install one of my peerDependencies. I believe that extraneous means the package exists but is not listed in package.json (presumably because it's installed globally?).
What does it mean to have the two of them together?
And why am I seeing this error even though I see these packages in node_modules, at the correct versions?
It means that you have a module installed in your local npm repo that is "extraneous" (meaning you have no dependency on it) that has an "unmet peer dependency" on a library you also do not have installed (or if you do have it installed locally or globally, it is also extraneous so it's not in your dependency tree). If you run npm prune it should remove the extraneous dependency and this message.