installing node dependencies manually - npm

As I've learned from SO topics dependencies for node aren't installed automatically on the fly since npm version 3. I'm running version 3.5.2 and I get these warnings when running npm install --no-optional:
npm WARN eslint-config-react-app#5.0.2 requires a peer of #typescript-eslint/eslint-plugin#2.x but none was installed.
npm WARN eslint-config-react-app#5.0.2 requires a peer of #typescript-eslint/parser#2.x but none was installed.
npm WARN eslint-config-react-app#5.0.2 requires a peer of eslint#6.x but none was installed.
npm WARN ts-pnp#1.1.2 requires a peer of typescript#* but none was installed.
npm WARN tsutils#3.17.1 requires a peer of typescript#>=2.8.0 || >= 3.2.0-dev
npm ERR! Missing: react-router-dom#^5.1.2
npm ERR! Invalid: lock file's #typescript-eslint/eslint-plugin#1.13.0 does not satisfy #typescript-eslint/eslint-plugin#2.8.0
npm ERR!
How do I install these manually ?
I tried:
npm install #typescript-eslint/eslint-plugin#2.*
npm install eslint#6.*
npm install typescript#*
but that did no good. Still throws those warnings.
I got little bit further:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #typescript-eslint/eslint-plugin#^5.16.0.
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! notarget
npm ERR! notarget It was specified as a dependency of 'client'
npm ERR! notarget
npm ERR! A complete log of this run can be found in:
npm ERR! /home/mark/.npm/_logs/2019-10-04T20_26_24_111Z-debug.log

Please use the following for each peer dependency to install that and remove the error.
$ npm install --save-dev #typescript-eslint
For another error,
No matching version found for #typescript-eslint/eslint-plugin#^5.16.0.
Please run npm view #typescript-eslint/eslint-plugin.
Then, you can see that highest version of #typescript-eslint/eslint-plugin is 2.3.2 now. This #typescript-eslint/eslint-plugin#^5.16.0 version not exists.

Related

NPM peer dependency conflict caused through (correct) peerDependency

I created several NPM libraries myself.
One of them is called datahive-ngx-graph and has version number 0.0.11
Another one is called datahive-ngx-spo-layout and has a version number 0.0.7
The datahive-ngx-spo-layout needs the ngx-graph package and therefore has a peerDependency for it in the package.json:
"datahive-ngx-graph": "^0.0.9",
This means for me that the datahive-ngx-spo-layout can only be installed in projects that have at least version 0.0.9 but < 0.1.0 of this package installed.
My current project has the following entries:
"datahive-ngx-graph": "^0.0.11",
"datahive-ngx-spo-layout": "^0.0.7",
So the requirement should be fulfilled, right?
But when I do npm install, I still get the following error message:
npm ERR! code ERESOLVE npm ERR! ERESOLVE unable to resolve dependency
tree npm ERR! npm ERR! While resolving: group-hive#1.0.0 npm ERR!
Found: datahive-ngx-graph#0.0.11 npm ERR!
node_modules/datahive-ngx-graph npm ERR!
datahive-ngx-graph#"^0.0.11" from the root project npm ERR! npm ERR!
Could not resolve dependency: npm ERR! peer
datahive-ngx-graph#"^0.0.9" from datahive-ngx-spo-layout#0.0.7 npm
ERR! node_modules/datahive-ngx-spo-layout npm ERR!
datahive-ngx-spo-layout#"^0.0.7" from the root project
This appears strange to me. Did I misunderstand something regarding the meaning of ^ or ~ in the NPM package names?
Where could be my problem?

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

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.

Cannot upgrade to Vue 3

I'm trying to upgrade my app from Vue 2 to Vue 3 following this guide:
https://v3-migration.vuejs.org/breaking-changes/migration-build.html#installation
However I fail at multiple levels
When I want to upgrade loader npm install vue-loader#^16.0.0
npm ERR! notarget No matching version found for #vue/babel-preset-app#^4.5.13.
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! /Users/chyno/.npm/_logs/2021-07-25T08_33_22_878Z-debug.log
When I want to upgrade cli service vue upgrade
npm ERR! code ETARGET
npm ERR! notarget No matching version found for #vue/cli-service#~4.5.13.
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! /Users/chyno/.npm/_logs/2021-07-25T08_41_29_627Z-debug.log
ERROR command failed: npm install --loglevel error #vue/cli-service#~4.5.13
When updating package.json according to the guide
npm ERR! notarget No matching version found for #vue/compiler-sfc#^3.1.0.
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! /Users/chyno/.npm/_logs/2021-07-25T08_44_50_636Z-debug.log
I'm using nvm 0.38.0, node v16.5.0, npm 7.19.1

"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

Why can't I install bootstrap-vue

I'm trying to install bootstrap-vue to my vue project, using the command npm install bootstrap-vue bootstrap but I get this mysterious error.
npm WARN deprecated popper.js#1.16.1: You can find the new Popper v2 at #popperjs/core, this package is dedicated to the legacy v1
npm WARN #vue/cli-plugin-typescript#4.5.7 requires a peer of #vue/compiler-sfc#^3.0.0-beta.14 but none is installed. You must install peer dependencies yourself.
npm WARN #vue/cli-service#4.5.7 requires a peer of #vue/compiler-sfc#^3.0.0-beta.14 but none is installed. You must install peer dependencies yourself.
npm WARN jsdom#15.2.1 requires a peer of canvas#^2.5.0 but none is installed. You must install peer dependencies yourself.
npm WARN ws#7.3.1 requires a peer of bufferutil#^4.0.1 but none is installed. You must install peer dependencies yourself.
npm WARN ws#7.3.1 requires a peer of utf-8-validate#^5.0.2 but none is installed. You must install peer dependencies yourself.
npm WARN bootstrap#4.5.3 requires a peer of jquery#1.9.1 - 3 but none is installed. You must install peer dependencies yourself.
npm ERR! path C:\Users\roeir\OneDrive\שולחן העבודה\Programming stuff\Chatting app\chat-client\node_modules\#nuxt\opencollective\node_modules\chalk
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\roeir\OneDrive\שולחן העבודה\Programming stuff\Chatting app\chat-client\node_modules\#nuxt\opencollective\node_modules\chalk' -> 'C:\Users\roeir\OneDrive\שולחן העבודה\Programming stuff\Chatting app\chat-client\node_modules\#nuxt\opencollective\node_modules\.chalk.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\roeir\AppData\Roaming\npm-cache\_logs\2020-11-08T14_54_53_107Z-debug.log
this is my directory C:\Users\roeir\OneDrive\שולחן העבודה\Programming stuff\Chatting app\chat-client
Did you try:
npm i bootstrap-vue
Had the same issue and this (found on https://www.npmjs.com/package/bootstrap-vue) solved my problem.