I am not able to install npm packages on my vaadin project - npm

happy new year!
Any package that I am trying to install I am getting this:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: #rollup/pluginutils#3.1.0
npm ERR! Found: dev #rollup/plugin-typescript#"^3.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! dev #rollup/plugin-typescript#"^3.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.
npm ERR!
npm ERR! See ~/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! ~/.npm/_logs/2022-01-02T16_54_42_026Z-debug.log
I am trying to use this npm install --save #fortawesome/fontawesome-free
I don't understand what could be wrong.

as it said in the error, you are handling an old package dependency and therefore you can use --force, or --legacy-peer-deps
Another solution that worked for me, and I think is better, try to install it through pnpm, as it seems to handle it.

I will guess you have decided to update npm itself recently on your local env.
if you run the following (as per your error message), it should install dependencies without trouble.
npm i --legacy-peer-deps
Running npm v8+ to update your dependencies will upgrade the version of your package-lock.json. The issue is that your repo libraries have many old dependencies which might not be compatible with this update. When you run npm with --legacy-peer-deps it uses the old ways...

I have encountered similar problems. After checking, I found that the primary group permission of the node program home directory is 500.500, which needs to be set to root root

Did you try this :
sudo npm install --save #fortawesome/fontawesome-free

Related

Failure to setup and build IFC.js project with npm

I'm triyng to get acquainted with IFC.js API. Starting from the start, I first tried to setup and build step by step the "hello world" tutorial. Installing the last dependancy failed with the following error message :
npm install #open-wc/building-rollup --save-dev
npm ERR! node_modules/rollup
npm ERR! dev rollup#"^3.10.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rollup#"^2.11.0" from #open-wc/building-rollup#2.2.1
npm ERR! node_modules/#open-wc/building-rollup
npm ERR! dev #open-wc/building-rollup#"*" 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.
I tried the command again with "--legacy-peer-deps" as suggested, without success. I finally by-passed this step by forcing this installation (--force). Unfortunately, after completing the setup, and as I could have expected, the app doesn't build at the end.
Any help would be warmly welcome !

Fix the upstream dependency conflict tfjs-react-native

I'm trying to install tfjs-react-native for a project that it's also using expo-camera but I get an error.
I followed the instructions on https://www.npmjs.com/package/#tensorflow/tfjs-react-native and installed every dependency, but I fail at the last step which is:
npm install #tensorflow/tfjs-react-native
I'm not able to understand what it's asking me. It seems that tfjs-react-native tries to use expo-camera#7 and I have installed the last one which is 12.3.0. Is that the problem? If so how can I fix this?
Hopefully somebody can help me out. Thanks
While resolving: alpr#1.0.0 npm ERR! Found: expo-camera#12.3.0 npm
ERR! node_modules/expo-camera npm ERR! expo-camera#"~12.3.0" from
the root project npm ERR! npm ERR! Could not resolve dependency: npm
ERR! peer expo-camera#"^7.0.0" from
#tensorflow/tfjs-react-native#0.8.0 npm ERR!
node_modules/#tensorflow/tfjs-react-native npm ERR!
#tensorflow/tfjs-react-native#"^0.8.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.
I solved it using --legacy-peer-deps. Now I was able to install it, my project still don't work but I will post the problem in another question.

i cant install vue-router by npm

i want to install vue-router but some errors occurs
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: routing01#1.0.0
npm ERR! Found: vue#2.6.14
npm ERR! node_modules/vue
npm ERR! vue#"^2.5.11" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer vue#"^3.2.0" from vue-router#4.0.15
npm ERR! node_modules/vue-router
npm ERR! vue-router#"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!
npm ERR! See C:\Users\Peyman\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\Peyman\AppData\Local\npm-cache\_logs\2022-05-31T07_48_48_170Z-debug-0.log
The problem is you have incompatible versions of vue and vue-router.
vue#2 requires vue-router#3
vue#3 requires vue-router#4
The error message indicates you have vue#2.6.14, and you're trying to install vue-router#4.0.15. Note that npm install -S vue-router (without a version specifier) defaults to the latest version, which is currently 4.0.15.
Don't use the --force or --legacy-peer-deps npm flags that are suggested in the error message because that would only install incompatible packages that would result in a runtime error.
Solution
A quick fix is to install vue-router#3:
npm install -S vue-router#3
Or you can upgrade to Vue 3, which requires uninstalling vue-template-compiler (the template compiler for Vue 2) and installing #vue/compiler-sfc (the template compiler for Vue 3):
npm uninstall -S vue-template-compiler
npm install -S vue#3 #vue/compiler-sfc
you can add by using plugin also using vue-cli.
try vue add router
btw use can install vuetify and eslint and many more things using vue add vuetify and vue add eslint
you can refer this: https://cli.vuejs.org/guide/plugins-and-presets.html#plugins
Try -
npm install --save --legacy-peer-deps
This command will tell npm to ignore peer dependencies

How to handle conflicting peer dependencies?

As a devDependency I have installed "#typescript-eslint/parser": "~4.31.2"
Running npm install tells me, that a package needs 4.20.0 and another one 4.28.3 - if I understand the error correctly.
How do I handle these npm package conflicts?
npm ERR! While resolving: #nrwl/eslint-plugin-nx#12.9.0
npm ERR! Found: #typescript-eslint/parser#4.31.2
npm ERR! node_modules/#typescript-eslint/parser
npm ERR! dev #typescript-eslint/parser#"~4.31.2" from the root project
npm ERR! #typescript-eslint/parser#"^4.20.0" from eslint-config-next#11.1.2
npm ERR! node_modules/eslint-config-next
npm ERR! dev eslint-config-next#"11.1.2" from the root project
npm ERR! eslint-config-next#"^11.1.0" from #nrwl/next#12.9.0
npm ERR! node_modules/#nrwl/next
npm ERR! dev #nrwl/next#"12.9.0" from the root project
npm ERR! 1 more (#typescript-eslint/eslint-plugin)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #typescript-eslint/parser#"~4.28.3" from #nrwl/eslint-plugin-nx#12.9.0
npm ERR! node_modules/#nrwl/eslint-plugin-nx
npm ERR! dev #nrwl/eslint-plugin-nx#"12.9.0" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: #typescript-eslint/parser#4.28.5
npm ERR! node_modules/#typescript-eslint/parser
npm ERR! peer #typescript-eslint/parser#"~4.28.3" from #nrwl/eslint-plugin-nx#12.9.0
npm ERR! node_modules/#nrwl/eslint-plugin-nx
npm ERR! dev #nrwl/eslint-plugin-nx#"12.9.0" from the root project
You are using npm 7.x, which is more strict about peer dependencies than npm 6.x. The easiest solution is to run npm install with the --legacy-peer-deps flag. In theory, that may result in some incompatibility issues with peer dependencies. In practice, a lot of people do it anyway. And a lot of people are running npm 6.x and that is the default behavior there, so a lot of people are doing it perhaps without even realizing it.
In your case, #nrwl/eslint-plugin-nx#12.9.0 says that it requires #typescript-eslint/parser#4.28.x and you are installing #typescript-eslint/parser#4.31.2. So if you don't want to use npm 6.x or the --legacy-peer-deps solution, another possibility is to install #typescript-eslint/parser#4.28.5 instead of 4.31.2.
Another thing you can do is open a pull request to update #nrwl/eslint-plugin-nx to use ^ in the relevant peerDependencies entry instead of ~. That will allow 4.x for the peer dependency, rather than limiting it to 4.28.x. It's possible they limited it so severely on purpose, but probably not. (I went to look, but there are hundreds of issues opened in that repository so I didn't spend time looking through them.)
Encountered similar errors when running an Azure DevOps build pipeline (which hadn't changed) against source code that also hadn't changed.
Adding the -g npm-reinstall option to the npm install step resolved the issue.
npm install -g npm-reinstall
While using nx monorepo the solution was to run nx migrate 'package'
e.g.
nx migrate #typescript-eslint/parser

"ERESOLVE unable to resolve dependency tree" when setting up a new project using wdio-v7

I am trying to set up a new project using wdio-v7,
firstly I ran npm init -y
then npm install #wdio/cli --save-dev
and after running npx wdio config -y I receive this:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: example-test#1.0.0
npm ERR! Found: #wdio/cli#7.0.5
npm ERR! node_modules/#wdio/cli
npm ERR! dev #wdio/cli#"^7.0.5" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer #wdio/cli#"^6.0.0" from wdio-chromedriver-service#6.0.4
npm ERR! node_modules/wdio-chromedriver-service
npm ERR! dev wdio-chromedriver-service#"*" 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!
Initialize WebdriverIO and setup configuration in your current project.
Documentation: https://webdriver.io
#wdio/cli (v7.0.5)
I tried using --force, or --legacy-peer-deps but unsuccessful.
That is weird, looks like npx wdio config -yis trying to install older version of chrome driver service.
Try to manually install chromedriver service or update the version in package.json
"wdio-chromedriver-service": "^7.0.0"
Make sure you have the min requirements by webdriverio
https://webdriver.io/docs/gettingstarted#system-requirements
Install at least v12.16.1 or higher as this is the oldest active LTS
version Only releases that are or will become an LTS release are
officially supported