Metro: peer invalid: @babel/[email protected]

Created on 22 Mar 2018  ยท  9Comments  ยท  Source: facebook/metro

Do you want to request a feature or report a bug?
Bug.
It affects React Native too https://github.com/facebook/react-native/issues/18490

What is the current behavior?
Can not generate npm-shrinkwrap.json file.
With command npm ls @babel/[email protected] I discovered that problem is in metro bundler package

โ””โ”€โ”ฌ [email protected]
  โ””โ”€โ”ฌ [email protected]
    โ”œโ”€โ”€ UNMET PEER DEPENDENCY @babel/[email protected]
    โ””โ”€โ”€ @babel/[email protected]

If the current behavior is a bug, please provide the steps to reproduce and a minimal repository on GitHub that we can yarn install and yarn test.
Create new React Native app via react-native init, install node packages and run npm shrinkwrap command

What is the expected behavior?
Generated npm-shrinkwrap.json file

Please provide your exact Metro configuration and mention your Metro, node, yarn/npm version and operating system.
Environment:
OS: Linux 4.4
Node: 6.13.1
Yarn: Not Found
npm: 3.10.10
Watchman: 4.9.0
Xcode: N/A
Android Studio: 3.0 AI-171.4443003

Packages: (wanted => installed)
react: 16.3.0-alpha.1 => 16.3.0-alpha.1
react-native: 0.54.2 => 0.54.2

Most helpful comment

This issue is back in 0.57.2:

yarn check v1.10.1
warning "sane#fsevents#node-pre-gyp@^0.10.0" could be deduped from "0.10.3" to "[email protected]"
error "metro#babel-preset-fbjs#@babel/plugin-check-constants#@babel/[email protected]" doesn't satisfy found match of "@babel/[email protected]"
error Found 1 errors.

All 9 comments

You can spot the problem by simply creating a new project with react-native init, and then checking it with yarn check.

yarn check v1.5.1
warning "sane#fsevents#node-pre-gyp@^0.6.39" could be deduped from "0.6.39" to "[email protected]"
error "metro#@babel/plugin-check-constants#@babel/[email protected]" doesn't satisfy found match of "@babel/[email protected]"
error An unexpected error occurred: "Found 1 errors.".

the same problem .
โ””โ”€โ”ฌ [email protected]
โ””โ”€โ”ฌ [email protected]
โ””โ”€โ”€ @babel/[email protected]
Most other plugins are peer dep @babel/[email protected].
Only this plugin depends on
@babel/[email protected] .

We've locked the version down today. It may be a few days and after that I expect stability around this issue. Should have done it sooner. Hope the situation improves. If the issue comes back after that please re-open this issue.

@rafeca this can be closed.

This issue is back in 0.57.2:

yarn check v1.10.1
warning "sane#fsevents#node-pre-gyp@^0.10.0" could be deduped from "0.10.3" to "[email protected]"
error "metro#babel-preset-fbjs#@babel/plugin-check-constants#@babel/[email protected]" doesn't satisfy found match of "@babel/[email protected]"
error Found 1 errors.

the same problem in 0.57.3

error "metro#babel-preset-fbjs#@babel/plugin-check-constants#@babel/[email protected]" doesn't satisfy found match of "@babel/[email protected]"
error Found 1 errors.

Hello @rafeca @pvdz,

With v0.48.1, there is a peer dependency with @babel/[email protected]. Our application is in the midst of upgrading to babel7. Is it possible to not have this peer dep?

Hi!

Thanks for the heads up here! babel-beta.38 is being installed due to babel-preset-fbjs. It seems that with babel@7 stable @babel/plugin-check-constants is not needed anymore so we're going to remove it from the corresponding package ๐Ÿ˜„

/cc @jstejada

@rafeca Thank you ๐Ÿ™‚, this will be one of the last two TODOs before we can merge our babel7 upgrade. Any chance that we could get this peer dep removed this week, appreciate it!

Is the problem solved? I still got the warning when running yarn check.
warning "sane#fsevents#node-pre-gyp@^0.10.0" could be deduped from "0.10.3" to "[email protected]"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Naturalclar picture Naturalclar  ยท  4Comments

vicki15 picture vicki15  ยท  3Comments

alexanderoskin picture alexanderoskin  ยท  5Comments

aleclarson picture aleclarson  ยท  4Comments

brentvatne picture brentvatne  ยท  4Comments