'npm install' gives warnings at first but a second execution gives errors - npm

Im upgrading my project to react v18. Im using multiple packages relying on react v17.
My process for doing the upgrade is to update react to v18 and run npm install.
It gives peer dependency errors. I go and fix one by one.
I run npm install after updating a package version to one that supports react v18.
But something "weird" is happening. First time I run npm install it throws me warning:
npm WARN ERESOLVE overriding peer dependency
npm WARN ERESOLVE overriding peer dependency
npm WARN While resolving: react-popper#2.2.5
npm WARN Found: react#18.2.0
npm WARN node_modules/react
npm WARN peer react#"0.14.x || ^15.0.0 || ^16.0.0 || ^17.0.0" from react-popper#1.3.11
npm WARN node_modules/#blueprintjs/core/node_modules/react-popper
npm WARN react-popper#"^1.3.7" from #blueprintjs/core#4.6.0
npm WARN node_modules/#blueprintjs/core
npm WARN
npm WARN Could not resolve dependency:
npm WARN peer react#"^16.8.0 || ^17" from react-popper#2.2.5
npm WARN node_modules/#blueprintjs/popover2/node_modules/react-popper
npm WARN react-popper#"^2.2.4" from #blueprintjs/popover2#1.4.2
npm WARN node_modules/#blueprintjs/popover2
Ok, I got warnings but installation is not broken. Now, if I run again npm install without modifying anything it will throw errors:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #storybook/addon-essentials#6.4.22
npm ERR! Found: react#18.2.0
npm ERR! node_modules/react
npm ERR! react#"18.2.0" from the root project
npm ERR! peer react#"^16.8 || 17 || 18" from #blueprintjs/core#4.6.0
npm ERR! node_modules/#blueprintjs/core
npm ERR! #blueprintjs/core#"^4.6.0" from the root project
npm ERR! #blueprintjs/core#"^4.6.0" from #blueprintjs/datetime#4.3.2
npm ERR! node_modules/#blueprintjs/datetime
npm ERR! #blueprintjs/datetime#"^4.3.2" from the root project
npm ERR! 1 more (#blueprintjs/popover2)
npm ERR! 39 more (#blueprintjs/datetime, #blueprintjs/popover2, ...)
npm ERR!
Why it did not throw these errors with the first npm install ?
It looks weird to me that at first it only throws warnings but executing npm install a second time it does actually throw. I could clearly see issues into committing package-lock.json changes where there are only warnings to find later that running npm install throws errors.
Is this execution normal ?
Not sure if this question is for stack overflow or some other channel. Please, let me know if it does not belong to here.

Related

chart-js - npm install show version conflicts

after the clone of the latest 4.1.2 version of Chart.js I tried to set up the environment using
npm install the result is a version conflict
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
details see below.
from my understanding the rollup installation should work "^3.x.x" === ">=3.x.x" so 3.9.1 should fit (https://github.com/isaacs/node-semver "^3.3.0" === "3.3.0" <= V < 4.x.x)
rollup-7.0.2 will not fit ("^2.0.0" <= V <= "3.x.x" < 7.x.x)
If I do this using npm install --legacy-peer-deps the result is a deprecated package message-
npm WARN deprecated har-validator#5.1.5: this library is no longer supported
Details below.
It is ubuntu server 22.04LTS with nodes (incl. npm) from nodesource (node 18.12.1, npm 8.19.2).
Any hints are welcome.
I did
npm install
result:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: chart.js#4.1.2
npm ERR! Found: rollup#3.9.1
npm ERR! node_modules/rollup
npm ERR! dev rollup#"^3.3.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rollup#"^2.0.0" from rollup-plugin-terser#7.0.2
npm ERR! node_modules/rollup-plugin-terser
npm ERR! dev rollup-plugin-terser#"^7.0.2" 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.
and
npm install --legacy-peer-deps

Fix the upstream dependency conflict, React Native Expo

I have a React Native Expo application, and I am trying to install expo-splash-screen with running npx expo install expo-splash-screen
As a result I get the following error message:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: react-navigation-drawer#2.7.2
npm ERR! Found: react-native-gesture-handler#2.5.0
npm ERR! node_modules/react-native-gesture-handler
npm ERR! peer react-native-gesture-handler#">= 1.0.0" from #react-navigation/drawer#6.5.0
npm ERR! node_modules/#react-navigation/drawer
npm ERR! #react-navigation/drawer#"^6.5.0" from the root project
npm ERR! peer react-native-gesture-handler#">= 1.5.0" from react-navigation-stack#2.10.4
npm ERR! node_modules/react-navigation-stack
npm ERR! react-navigation-stack#"^2.10.4" from the root project
npm ERR! 1 more (the root project)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react-native-gesture-handler#"^1.0.12" from react-navigation-drawer#2.7.2
npm ERR! node_modules/react-navigation-drawer
npm ERR! react-navigation-drawer#"^2.7.2" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: react-native-gesture-handler#1.10.3
npm ERR! node_modules/react-native-gesture-handler
npm ERR! peer react-native-gesture-handler#"^1.0.12" from react-navigation-drawer#2.7.2
npm ERR! node_modules/react-navigation-drawer
npm ERR! react-navigation-drawer#"^2.7.2" 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.
While running npm -v react-native-gessture-handler it says: 8.15.0.
I have also tried using npm i react-native-splash-screen --force but it is not good for an expo application, and I am pretty sure that installing react-navigation-drawer with --force resulted the problem.
I am not really experienced with package managing so I do not really get the point of the error message. How can I install expo-splash-screen, and can somebody explain the error message?
It looks you have libraries that use different versions of react-native-gesture-handler. react-navigation-drawer is using and older react-native-gesture-handler version and this package is deprecated so you cannot update it to use a higher version of react-native-gesture-handler.
The best solution in my opinion is to change the package react-navigation-drawer to #react-navigation/drawer as it says in the documentation of the package.
The other alternative but at your own risk is to specify in the package.json a resolution with the react-native-gesture-handler you need in expo-splash-screen and every library that have as peer dependecy react-native-gesture-handler will use this specific version.
"resolutions": {
"react-native-gesture-handler": "x.x.x"
}
Let me know if it helps

Troubleshooting npx create-strapi-app error

After running npx create-strapi-app#3 cartdb --quickstart I get a list of errors posted below:
Creating a quickstart project.
Creating files.
- Installing dependencies:
Error while installing dependencies:
npm WARN config production Use `--omit=dev` instead.
npm WARN config optional Use `--omit=optional` to exclude optional dependencies, or
npm WARN config `--include=optional` to include them.
npm WARN config
npm WARN config Default value does install optional deps unless otherwise omitted.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: cartdb#0.1.0
npm ERR! Found: knex#0.19.5
npm ERR! node_modules/knex
npm ERR! knex#"<0.20.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer knex#"^0.20.0" from strapi-connector-bookshelf#3.1.4
npm ERR! node_modules/strapi-connector-bookshelf
npm ERR! strapi-connector-bookshelf#"3.1.4" 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!
Keep trying!
I've updated npm and node but still encounter this error. I'm still at a lost after reading through the strapi documentation and some other answers on stackoverflow

Eslint somehow got messed up, Shopware build fails

I have a big problem with the Node.js module eslint within Shopware 6. Out of nowhere I get an error message about a conflicting dependency while building Showpware's storefront and administration:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: eslint-config-airbnb-base#13.2.0
npm ERR! Found: eslint#7.10.0
npm ERR! node_modules/eslint
npm ERR! dev eslint#"7.10.0" from the root project
npm ERR! peer eslint#"^6.0.0 || ^7.0.0 || ^8.0.0" from #typescript-eslint/eslint-plugin#5.1.0
npm ERR! node_modules/#typescript-eslint/eslint-plugin
npm ERR! #typescript-eslint/eslint-plugin#"5.1.0" from the root project
npm ERR! 14 more (#typescript-eslint/experimental-utils, eslint-utils, ...)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer eslint#"^4.19.1 || ^5.3.0" from eslint-config-airbnb-base#13.2.0
npm ERR! node_modules/eslint-config-airbnb-base
npm ERR! dev eslint-config-airbnb-base#"13.2.0" from the root project
npm ERR! eslint-config-airbnb-base#"^13.2.0" from #shopware-ag/eslint-config-base#1.0.0
npm ERR! node_modules/#shopware-ag/eslint-config-base
npm ERR! #shopware-ag/eslint-config-base#"1.0.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: eslint#5.16.0
npm ERR! node_modules/eslint
npm ERR! peer eslint#"^4.19.1 || ^5.3.0" from eslint-config-airbnb-base#13.2.0
npm ERR! node_modules/eslint-config-airbnb-base
npm ERR! dev eslint-config-airbnb-base#"13.2.0" from the root project
npm ERR! eslint-config-airbnb-base#"^13.2.0" from #shopware-ag/eslint-config-base#1.0.0
npm ERR! node_modules/#shopware-ag/eslint-config-base
npm ERR! #shopware-ag/eslint-config-base#"1.0.0" 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.
Neither did I manually modify any parts of the Shopware core nor did I install any updates. This error message shows up when I run build.sh. At some point it executes build-js.sh which crashes immediately. This also happened to other Shopware installations we maintain. I also tried to reinstall a broken installation from scratch but after some time it shows the same error message when I start the building process.
All affected installations run with Shopware 6.4.x.x.
Node.js is 16.15.1 LTS, npm is 8.11.0
Any help with this is greatly appreciated!
I remember that this problem existed a while ago. The problem is that Node 16.15.1 bumped the NPM version from 8.5.5 to 8.11.0. This causes the peer dependency problem. However, we fixed this issue in mid-May. So with trunk and the latest 6.4 release, the problem should vanish. If that's not the case, try to fix this by changing npm to a version <8.11.0.

React-navigation- dependencies (Error while install NPM navigation dependencies package installation)

when I install this package
1 . npm install #react-native-community/masked-view .
it shows error like this
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: Sample_pro#0.0.1
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.0" from #react-native-community/masked-view#0.1.10
npm ERR! node_modules/#react-native-community/masked-view
npm ERR! #react-native-community/masked-view#"*" 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 C:\Users\HP\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\HP\AppData\Local\npm-cache_logs\2021-04-21T03_52_51_024Z-debug.log
-----How should I solve this problem-----
Ther error message is telling you that
your proj is using react # 17.0.1 version while #react-native-community/masked-view 0.1.10 has a dependency of react # 16.
To solve it, you can choose one of the followings:
upgrade #react-native-community/masked-view to the latest package which is accepting react#16 and react#17
downgrade your root project's react version to 16
please remove package-lock.json file and try to install again hope it will work.