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

"babel-loader@7.1.2" has unmet peer dependency "webpack@2 || 3" #4589

Closed
alansouzati opened this issue Sep 29, 2017 · 9 comments
Closed

"babel-loader@7.1.2" has unmet peer dependency "webpack@2 || 3" #4589

alansouzati opened this issue Sep 29, 2017 · 9 comments

Comments

@alansouzati
Copy link

Do you want to request a feature or report a bug?

Report a bug

What is the current behavior?

The following structure in peerDependency does not show any warning with npm install.

  "peerDependencies": {
    "babel-core": "6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc",
    "webpack": "2 || 3"
  },

https://github.com/babel/babel-loader/blob/master/package.json#L19

Replacing "webpack": "2 || 3" with "webpack": "^2.0.0 || ^3.0.0" removes the warning.

FYI the peer webpack version is set to 3.4.1
If the current behavior is a bug, please provide the steps to reproduce.

Run yarn install

What is the expected behavior?

No warnings

Please mention your node.js, yarn and operating system version.

Node: 6.11.x
Yarn: 1.1.0
OSx 10

@edmorley
Copy link
Contributor

Hi!

Using yarn 1.2.1, node 8.6.0, MSYS2 under Windows x64, I cannot reproduce (I get two react releated peer dependency warnings instead, but they seem legit).

@alansouzati, could you confirm this is fixed in latest yarn? :-)

For reference, I used the following STR:

  1. git clone https://github.com/babel/babel-loader
  2. cd babel-loader
  3. yarn install

@BYK
Copy link
Member

BYK commented Oct 16, 2017

I think we've fixed this with the 1.2.0 line. Thanks a lot @edmorley for checking :)

@BYK BYK closed this as completed Oct 16, 2017
@reinseth
Copy link

I can still reproduce this error.

Steps to reproduce:

mkdir yarn-test
cd yarn-test
yarn init
yarn add -D babel-loader

Gives the following output:

yarn add v1.2.1
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
warning "babel-loader@7.1.2" has unmet peer dependency "babel-core@6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc".
warning "babel-loader@7.1.2" has unmet peer dependency "webpack@2 || 3".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 17 new dependencies.
├─ babel-loader@7.1.2
├─ big.js@3.2.0
├─ commondir@1.0.1
├─ emojis-list@2.1.0
├─ find-cache-dir@1.0.0
├─ find-up@2.1.0
├─ json5@0.5.1
├─ loader-utils@1.1.0
├─ locate-path@2.0.0
├─ make-dir@1.0.0
├─ minimist@0.0.8
├─ mkdirp@0.5.1
├─ p-limit@1.1.0
├─ p-locate@2.0.0
├─ path-exists@3.0.0
├─ pify@2.3.0
└─ pkg-dir@2.0.0
Done in 1.15s.

Node: v8.6.0
Yarn: 1.2.1
OS: Ubuntu 16.04

@edmorley
Copy link
Contributor

@reinseth, the error is correct in that example - those dependencies are missing (that example doesn't install them, unlike the STR in the original post). babel-loader 7.1.2 has a peerDependencies that includes babel-core and webpack, but you're not installing them:
https://github.com/babel/babel-loader/blob/v7.1.2/package.json#L17-L20

See the installation instructions here:
https://github.com/babel/babel-loader#install

@reinseth
Copy link

Ah, thanks, I missed that. But there is still something interesting going on:
If I install webpack babel-core babel-loader everything is fine. If I also install babel-cli, however, I get the same error:

$ cat package.json
{
  "name": "yarn-test",
  "version": "1.0.0",
  "main": "index.js",
  "license": "MIT",
  "dependencies": {
    "babel-cli": "^6.26.0",
    "babel-core": "^6.26.0",
    "webpack": "^3.8.1"
  }
}

$ yarn add babel-loader
yarn add v1.2.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.1.2: The platform "linux" is incompatible with this module.
info "fsevents@1.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
warning "babel-loader@7.1.2" has unmet peer dependency "babel-core@6 || 7 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0-rc".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 5 new dependencies.
├─ babel-loader@7.1.2
├─ commondir@1.0.1
├─ find-cache-dir@1.0.0
├─ make-dir@1.0.0
└─ pkg-dir@2.0.0
Done in 1.64s.

@florianbepunkt
Copy link

Same here. I also get this error as soon as I also install babel-cli.

@hpg-mheck
Copy link

Me three. Reprouced this today in a sterile development environment being set up from scratch with @latest everything. babel-core, babel-loader, babel-cli. Getting complaints as if babel-core 7.x is a requirement, when it isn't out yet.

@CodeSigils
Copy link

CodeSigils commented Nov 2, 2017

This solved it for me on ubuntu 16.04 -- node v8.9.0 lts/carbon -- npm 5.5.1 -- yarn 1.2.1:
yarn add babel-loader@8.0.0-beta.0 @babel/core@next @babel/preset-env@next webpack

@hpg-mheck
Copy link

Yeah, that shut the yarn complaints up, but left me with a bunch of other problems.

Groan. Anything with references to "@next" "@latest" and crap like that is going to break in about a week. In the interests of preserving the sanity of anyone finding this while pulling their hair out, here is a consistent package.json hard version set that seems to work for me at the moment, with yarn, in a Visual Studio 2017 environment, writing Office Add-in stuff, right now, today, 03OCT2017:

{ "name": "yadda-whatever", "version": "1.0.0", "main": "index.js", "license": "MIT", "devDependencies": { "babel-loader": "6.4.0", "babel-preset-es2015": "6.24.1", "babel-preset-react": "6.24.1", "babel-preset-stage-1": "6.24.1", "webpack": "2.6.1", "webpack-dev-server": "2.4.5" }, "dependencies": { "alt": "^0.18.6", "babel-core": "6.24.1", "jshashes": "^1.0.7", "office-ui-fabric-react": "^5.18.0", "react": "15.4.2", "react-dom": "15.4.2" } }

Hopefully that at least helps some people landing on this problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants