question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unmet peer dependency insert-css@^0.2.0

See original GitHub issue

Hi @yoshuawuyts!

npm install sheetify

gives

+-- UNMET PEER DEPENDENCY insert-css@^0.2.0
`-- sheetify@5.0.0
  +-- falafel@1.2.0
  | `-- isarray@0.0.1
  `-- through2@2.0.1
    `-- readable-stream@2.0.6
      `-- isarray@1.0.0

That would not be bad but running browserify gives Cannot find module 'insert-css' from 'C:\Users\dmitry\Dropbox\Projects\gl-spectrum'.

Why inner-css dependency is considered peer, when it is critical to run sheetify?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
yoshuawuytscommented, May 15, 2016

The issue at hand here is that by using sheetify, insert-css will be required by your application. E.g. after running the transform your code turns from this:

const sf = require('sheetify')
sf`.foo { color: blue; }`

to:

const sf = 0
require('insert-css')('.foo { color: blue; }')

Because dependencies are recursively resolved upwards from the current project directory, a dependency of insert-css in the sheetify directory will not be found - unless in the case of npm@3 with flat dependencies, but given that not everyone runst that, it cannot be relied upon.

Perhaps this reasoning should be added to the documentation; but as it stands now I don’t see another way of guaranteeing sheetify to work other than relying on peer dependencies.

1reaction
kvnneffcommented, Jun 18, 2016

I just ran into this myself. Here’s how someone else is getting their peerDependencies working in both npm2 and npm3: https://codingwithspike.wordpress.com/2016/01/21/dealing-with-the-deprecation-of-peerdependencies-in-npm-3/

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I fix the npm UNMET PEER DEPENDENCY warning?
UNMET PEER DEPENDENCY error is thrown when the dependencies of one or more modules specified in the package.json file is not met.
Read more >
"Unmet peer dependency" with peer dependency already ...
Install dependency A (with transitive dependency AB) Later (contrary to #2132), install dependency C (which has AB as peer dep) -- an unmet...
Read more >
Error npm UNMET PEER DEPENDENCY warning - Edureka
UNMET PEER DEPENDENCY error is thrown when the dependencies of one or more modules specified in the package.json file is not met. Check...
Read more >
[package] has unmet peer dependency - Notes and Anecdotes
I'll sometime see a warning telling me that a dependency (that I have installed) has an unmet peer dependency. I don't know what...
Read more >
check-peer-dependencies | Yarn - Package Manager
Checks peer dependencies of the current NodeJS package. Offers solutions for any that are unmet. This utility will recursively find all peerDependencies in...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found