What should I do about "warning ... unmet peer dependency" when using yarn? - yarnpkg

I used yarn to install almost 1000 js libraries. When it's done I run yarn install --check-files and it warns me that it left out just a few. I find this bizarre that it installs almost all and only warns about not installing a small handful (but I'll read up on why yarn's doing that later), for now, I need to figure out what to do about these unmet peer dependencies?
Example output
yarn install --check-files
yarn install v1.22.19
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning " > babel-loader#8.3.0" has unmet peer dependency "#babel/core#^7.0.0".
warning " > babel-plugin-polyfill-corejs2#0.3.3" has unmet peer dependency "#babel/core#^7.0.0-0".
warning " > babel-plugin-polyfill-corejs3#0.6.0" has unmet peer dependency "#babel/core#^7.0.0-0".
warning " > babel-plugin-polyfill-regenerator#0.4.1" has unmet peer dependency "#babel/core#^7.0.0-0".
warning " > bootstrap#4.6.2" has unmet peer dependency "popper.js#^1.16.1".
[4/4] 🔨 Building fresh packages...
✨ Done in 1.52s.
My guess is simply install them with
yarn add #popper.js#^1.16.1
yarn add #babel/core#^7.0.0-0
I'm not totally sure though and want to get it right (also not sure if the first # and ^ should be there).
Note
Although I already mentioned it above and link to it, I reiterate, that this question differs from What does 'has unmet peer dependency' mean when installing a package with yarn? in that it asked about what a peer dependency is, whereas I (and 90 others) would like to know what must be done with yarn to ensure all (peer) dependencies are installed.

How to solve
Copy the name of the unmet peer dependency from the warning message, and add it using yarn like so:
yarn add '<unmet peer dependency>'
don't forget the ' and ' around the dependency, (and keep the # and ^ symbols if the unmet peer dependency has them).
Example
The error message in the question has
warning " > babel-plugin-polyfill-corejs2#0.3.3" has unmet peer dependency "#babel/core#^7.0.0-0".
so you'd run
yarn add '#babel/core#^7.0.0-0'
to add it.
Repeat this until all the warnings have gone when you run yarn install --check-files and the output just looks something like this (no warnings any more):
yarn install --check-files
yarn install v1.22.19
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
[4/4] 🔨 Building fresh packages...
✨ Done in 1.54s.

Related

Npm generate error when installing module

This is error
npm WARN bootstrap#4.0.0-beta.2 requires a peer of popper.js#^1.12.3 but none is installed. You must install peer dependencies yourself.
How can I solve this error?
Peer dependencies are NO LONGER INSTALLED AUTOMATICALLY from version 3.0
https://github.com/npm/npm/releases/tag/v3.0.0
You have to install it manually and make it part of your npm package.
npm install popper.js#^1.12.3 --save

Getting warning when installing packages via yarn for unmet peer dependencies even though they are added in node modules

System:
OS: macOS Mojave 10.14.5
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU # 2.30GHz
Memory: 50.37 MB / 8.00 GB
Shell: 5.3 - /bin/zsh
Binaries:
Node: 12.13.0 - ~/.nvm/versions/node/v12.13.0/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.12.0 - ~/.nvm/versions/node/v12.13.0/bin/npm
npmPackages:
babel-plugin-styled-components: ^1.10.6 => 1.10.6
styled-components: ^5.0.0-rc.1 => 5.0.0-rc.1
Why I am getting this warning, even though I can see packages in node_modules
yarn add eslint-config-airbnb
yarn add v1.19.1
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning "eslint-config-airbnb > eslint-config-airbnb-base#14.0.0" has unmet peer dependency "eslint-plugin-import#^2.18.2".
warning " > eslint-config-airbnb#18.0.1" has unmet peer dependency "eslint-plugin-import#^2.18.2".
warning " > eslint-config-airbnb#18.0.1" has unmet peer dependency "eslint-plugin-jsx-a11y#^6.2.3".
warning " > eslint-config-airbnb#18.0.1" has incorrect peer dependency "eslint-plugin-react-hooks#^1.7.0".
[4/4] 🔨 Building fresh packages...
success Saved lockfile.
success Saved 3 new dependencies.
info Direct dependencies
└─ eslint-config-airbnb#18.0.1
info All dependencies
├─ confusing-browser-globals#1.0.9
├─ eslint-config-airbnb-base#14.0.0
└─ eslint-config-airbnb#18.0.1
✨ Done in 3.24s.
yarn add styled-components#beta
yarn add v1.19.1
[1/4] 🔍 Resolving packages...
[2/4] 🚚 Fetching packages...
[3/4] 🔗 Linking dependencies...
warning "styled-components > stylis-rule-sheet#0.0.10" has unmet peer dependency "stylis#^3.5.0".
warning " > styled-components#5.0.0-rc.1" has unmet peer dependency "react-is#>= 16.8.0".
[4/4] 🔨 Building fresh packages...
success Saved 1 new dependency.
info Direct dependencies
└─ styled-components#5.0.0-rc.1
info All dependencies
└─ styled-components#5.0.0-rc.1
✨ Done in 3.19s.

Failure of yarn upgrade

When I want to upgrade a dependency of my project (lodash package), I run the following command:
yarn upgrade lodash
I face with the following error:
yarn upgrade v1.12.3
[1/4] Resolving packages...
[2/4] Fetching packages...
error https://registry.yarnpkg.com/path-postId/-/path-postId-2.0.1.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "Unexpected end of data"
I consulted the mentioned page but I couldn't find any useful information to resolve the issue.
The following steps resolved the problem:
Remove the yarn.lock file.
rm yarn.lock
Recreate the yarn.lock file by running the following command:
yarn install
Upgrade the dependency using --skip-integrity-check:
yarn upgrade --skip-integrity-check lodash

"Missing list of packages to add to your project" error while install Heroku deploy plugin

I want deploy my JHipster application to Heroku, but when I run command "jhipster heroku", I received the following error:
Installing Heroku CLI deployment plugin
× { Error: Command failed: heroku plugins:install heroku-cli-deploy --force
Installing plugin java... yarn add v1.12.3
Installing plugin java... [1/4] Resolving packages...Installing plugin java... [2/4] Fetching packages...Installing plugin java... [3/4] Linking dependencies...Installing plugin java... [4/4] Building fresh packages...Installing plugin java... success Saved 1 n
ew dependency.Installing plugin java... info Direct dependenciesInstalling plugin java... └─ #heroku-cli/plugin-java#3.0.1Installing plugin java... Done in 2.97s.Installing plugin java... installed v3.0.1
Installing plugin --force... yarn add v1.12.3
Installing plugin --force... info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.Installing plugin --force... !
error Missing list of packages to add to your project.
Error: yarn add --force#latest --non-interactive --mutex=file:C:/Users/start/AppData/Local/heroku/yarn.lock --preferred-cache-folder=C:/Users/start/AppData/Local/heroku/yarn --check-files --registry=https://registry.npmjs.org exited with code 1
at ChildProcess.forked.on (C:/Program Files/heroku/client/node_modules/#oclif/plugin-plugins/lib/yarn.js:31:28)
at ChildProcess.exithandler (child_process.js:275:12)
at emitTwo (events.js:126:13)
at ChildProcess.emit (events.js:214:7)
at maybeClose (internal/child_process.js:925:16)
at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
killed: false,
code: 1,
signal: null,
cmd: 'heroku plugins:install heroku-cli-deploy --force' }
Versions of tools:
JHipster: 5.1.0
Heroku: heroku/7.19.4 win32-x64 node-v11.3.0
Yarn: 1.7.0
Node: v8.10.0
I've already tried out the following commands:
heroku plugins:install java - successfully installed
heroku plugins:install heroku-cli-deploy --force -
Then an error occurs:
Installing plugin java... installed v3.0.1
error Missing list of packages to add to your project.
Installing plugin --force... !
Error: yarn add --force#latest --non-interactive --mutex=file:C:/Users/start/AppData/Local/heroku/yarn.lock --preferred-cache-folder=C:/Users/start/AppData/Local/heroku/yarn --check-files --registry=https://registry.npmjs.org exited with code 1
at ChildProcess.forked.on (C:/Program Files/heroku/client/node_modules/#oclif/plugin-plugins/lib/yarn.js:31:28)

Aptitude has unmet dependencies and encounters a segmentation fault when performing the recommended fix. How do I fix it?

I am on Ubuntu 17.10, freshly installed and tried to installed Ruby using apt-get install ruby-full. It failed to install and now aptitude says
The following packages have unmet dependencies:
ri: Depends: ruby2.3-doc but it is not installed
E: Unmet dependencies. Try 'apt --fix-broken install' with no packages (or specifiy a solution).
I tried the suggested command as well as sudo apt-get install -f -y to no avail: It begins the install process then tells me there was an error processing the ruby2.3-doc archive
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
ruby2.3-doc
The following NEW packages will be installed:
ruby2.3-doc
0 upgraded, 1 newly installed, 0 to remove and 17 not upgraded.
21 not fully installed or removed.
Need to get 0 B/3,382 kB of archives.
After this operation, 27.7 MB of additional disk space will be used.
(Reading database ... 182724 files and directories currently installed.)
Preparing to unpack .../ruby2.3-doc_2.3.3-1ubuntu1_all.deb ...
Unpacking ruby2.3-doc (2.3.3-1ubuntu1) ...
dpkg: error processing archive /var/cache/apt/archives/ruby2.3-doc_2.3.3-1ubuntu1_all.deb (--unpack):
unable to open '/usr/share/ri/2.3.0/system/page-ChangeLog-2_1_0.ri.dpkg->new': Operation not permitted
Errors were encountered while processing:
/var/cache/apt/archives/ruby2.3-doc_2.3.3-1ubuntu1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
I tried clearing aptitude's cache in case a package failed to download correctly but that did not fix it.
Because this means there are unmet dependencies, I'm unable to run other aptitude operations to try and install new packages or remove ruby-full.
How can I remove this ruby-full package so I can try again using rvm?
I ended up removing ri, ruby-full, and the other packages mentioned then ran apt-get update.

Resources