Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unmet peer dependency #438

Closed
niftylettuce opened this issue Jan 1, 2018 · 19 comments
Closed

unmet peer dependency #438

niftylettuce opened this issue Jan 1, 2018 · 19 comments

Comments

@niftylettuce
Copy link

shouldn't this be listed as a dependency instead in package.json?

warning " > postcss-cssnext@3.0.2" has unmet peer dependency "caniuse-lite@^1.0.30000697".
@niftylettuce
Copy link
Author

can we please make this a version range instead? https://github.com/MoOx/postcss-cssnext/blob/master/package.json#L57

if not, please put it as a dep in package.json

@RyanZim
Copy link
Collaborator

RyanZim commented Jan 2, 2018

@niftylettuce With a ^, it is a version range.

Also, You should be able to get rid of that warning by deleting node_modules and reinstalling. It's already included as a child dependency of autoprefixer IIRC.

@niftylettuce
Copy link
Author

it seems odd to not have other deps such as postcss included in peer deps. can we please just drop peer deps completely?

@MoOx
Copy link
Owner

MoOx commented Jan 2, 2018

postcss plugins actually require postcss as a dep to be able to register their plugins.
Everything is fine here.
The thing is: we rely on a package (caniuse-api) that can work with any caniuse-lite, but we need a specific version to be sure cssnext is working as expected.

@MoOx MoOx closed this as completed Jan 2, 2018
@niftylettuce
Copy link
Author

niftylettuce commented Jan 2, 2018

Can we please put this in as a core dependency? I'd hate to keep a separate repo maintained because otherwise end-users (using build systems like gulp or grunt) will always get this warning.

I did the classic rm -rf node_modules && rm yarn.lock && yarn and the warning still came up. The only way it went away was using my fork of this repo that has it listed as a dep and not a peer dep. I think this occurs for anyone using a build system like gulp/grunt.

Can anyone else here test and see if they can reproduce? If it's just on my end then of course we can ignore this all completely haha.

@MoOx
Copy link
Owner

MoOx commented Jan 2, 2018

This change has been made 6 months ago and we only got one or 2 people opening issues fixed with an uninstall + install, so I guess everything is fine in this code. I won't make add caniuse-lite as a dep as it's not a dep, rather a recommendation for our plugin to work correctly with another given dep.

@niftylettuce
Copy link
Author

I just tested on a new fresh repo and can't reproduce it anymore. You're right @MoOx this is just a weird edge case. Probably from working with local npm symlinks! Thanks for patience and helping me out here.

@niftylettuce
Copy link
Author

Actually I spoke too soon! This is in fact an issue. I tested the wrong plugin, not this one.

@RyanZim @MoOx here is how to reproduce (I made a test repo for you at https://github.com/niftylettuce/postcss-cssnext-test):

git clone https://github.com/niftylettuce/postcss-cssnext-test.git
cd postcss-cssnext-test
yarn
# or you could do `npm install` if you're not using yarn

Example output of running yarn or npm install

λ ~/Projects/postcss-css-next-test/ master* yarn
yarn install v1.3.2
info No lockfile found.
[1/4] 🔍  Resolving packages...
warning gulp > gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
warning gulp > vinyl-fs > graceful-fs@3.0.11: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
warning gulp > vinyl-fs > glob-stream > minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > minimatch@0.2.14: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
warning gulp > vinyl-fs > glob-watcher > gaze > globule > glob > graceful-fs@1.2.3: please upgrade to graceful-fs 4 for compatibility with current and future versions of Node.js
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > postcss-cssnext@3.0.2" has unmet peer dependency "caniuse-lite@^1.0.30000697".
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 7.75s.

You can see the unmet dependency warning.

Can you please re-open?

@MoOx
Copy link
Owner

MoOx commented Jan 2, 2018

What version of node/yarn are you using? Yarn got a tons of issues with peer deps in the past.
Please try with npm.

@niftylettuce
Copy link
Author

yarn --version
1.3.2
npm --version
5.6.0

@niftylettuce
Copy link
Author

Oh, I don't get this warning on npm install. Though shouldn't we consider that an extremely large percentage of users are using yarn? I just looked around the community and pretty much all the other plugins for postcss aren't using peerdeps.

@niftylettuce
Copy link
Author

Thanks again for patience + help here 👍

@MoOx
Copy link
Owner

MoOx commented Jan 2, 2018

@ghost
Copy link

ghost commented Mar 7, 2018

documenting.
this looks to still be:

yarnpkg/yarn#4850

with

yarn --version
	1.5.1
yarn info postcss-cssnext | grep version:
	version: '3.1.0',

On any yarn exec

...
warning " > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".
...

hails from

yarn info postcss-cssnext | grep caniuse-lite -A1 -B1
	peerDependencies:
	 { 'caniuse-lite': '^1.0.30000697' },
	devDependencies:

here

yarn info caniuse-lite | grep version:
	version: '1.0.30000813',

yarn info caniuse-lite
	yarn info v1.5.1
	{ name: 'caniuse-lite',
	  description: 'A smaller version of caniuse-db, with only the essentials!',
	  'dist-tags': 
	   { latest: '1.0.30000813' },

@ghost
Copy link

ghost commented Mar 11, 2018

Same issue.

$ rm -rf node_modules && rm yarn.lock && yarn
yarn install v1.5.1
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 22.26s.

@OzzyCzech
Copy link

Same here... yarn v1.5.1 and node v9.8.0

rm -rf node_modules && rm yarn.lock && yarn

produce following warning

warning " > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".

@megganeturner
Copy link

Also getting the same warning. yarn 1.5.1 and node 8.10.1.

rm -rf node_modules && rm yarn.lock && yarn

produces

warning " > postcss-cssnext@3.1.0" has unmet peer dependency "caniuse-lite@^1.0.30000697".

@Mayurifag
Copy link

+1 here

@RyanZim
Copy link
Collaborator

RyanZim commented May 31, 2018

postcss-cssnext has been deprecated in favor of postcss-preset-env. Read more at https://moox.io/blog/deprecating-cssnext/

Repository owner locked as resolved and limited conversation to collaborators May 31, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants