yarnpkg / yarn

The 1.x line is frozen - features and bugfixes now happen on https://github.com/yarnpkg/berry
https://classic.yarnpkg.com
Other
41.44k stars 2.73k forks source link

yarn install && yarn check = 150 errors #4534

Open bclinkinbeard opened 7 years ago

bclinkinbeard commented 7 years ago

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

What is the current behavior? Running yarn install && yarn check finds 4 warnings and 150 errors.

If the current behavior is a bug, please provide the steps to reproduce. See above.

This is the package.json ``` { "name": "idyll-components", "version": "2.0.0-alpha.7", "description": "Components that ship by default in new Idyll projects", "main": "dist/cjs/index.js", "module": "dist/es/index.js", "scripts": { "prebuild": "rimraf dist", "build:cjs": "cross-env BABEL_ENV=cjs babel src -d dist/cjs", "build:es": "cross-env BABEL_ENV=es babel src -d dist/es", "build": "npm run build:cjs && npm run build:es", "prepublishOnly": "npm run build", "test": "jest" }, "jest": { "testMatch": [ "**/test/**/*.js" ] }, "repository": { "type": "git", "url": "git+https://github.com/idyll-lang/idyll.git" }, "keywords": [ "Idyll" ], "authors": [ "Matthew Conlen", "Ben Clinkinbeard" ], "license": "MIT", "bugs": { "url": "https://github.com/idyll-lang/idyll/issues" }, "homepage": "https://github.com/idyll-lang/idyll#readme", "dependencies": { "babel-jest": "^21.0.2", "cross-env": "^5.0.5", "d3-array": "^1.2.0", "d3-drag": "^1.1.1", "d3-format": "^1.2.0", "d3-selection": "^1.1.0", "prop-types": "^15.5.10", "react-inlinesvg": "^0.6.2", "react-latex": "^1.0.1", "react-syntax-highlighter": "^5.7.0", "reactable": "^0.14.1", "victory": "^0.22.2" }, "peerDependencies": { "react": "^15.6.1", "react-dom": "^15.6.1" }, "devDependencies": { "babel-cli": "6.26.0", "babel-plugin-transform-object-rest-spread": "^6.26.0", "babel-preset-env": "^1.6.0", "babel-preset-react": "^6.24.1", "enzyme": "^2.9.1", "jest": "^21.1.0", "react": "^15.6.1", "react-addons-test-utils": "^15.6.0", "react-dom": "^15.6.1", "rimraf": "^2.6.2" } } ```

What is the expected behavior? I wouldn't expect errors right after an install

Please mention your node.js, yarn and operating system version. Node v8.5.0 Yarn 1.0.2 macOS 10.12.6

bitsapien commented 7 years ago

+1 I get this error too.

BYK commented 7 years ago

There was a bug regarding peerDependencies in this version. Can you try with 1.2.0? We are also working on a fix for another peer dependency resolution bug at the moment so you may wanna wait for 1.2.1 if 1.2.0 doesn't fix it.

bclinkinbeard commented 7 years ago

239 errors with v1.2.0 :)

bitsapien commented 7 years ago

I was on 1.0.2. From @bclinkinbeard's comment I see I'll have to wait for 1.2.1. Thanks for confirming.

jpickwell commented 7 years ago

Seems fixed.

Node 8.2.1, Yarn 1.3.2 (Homebrew), macOS 10.12.6

Output:

yarn install v1.3.2
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > babel-jest@21.2.0" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0".
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 18.80s.
yarn check v1.3.2
warning "chokidar#fsevents#node-pre-gyp@^0.6.36" could be deduped from "0.6.39" to "node-pre-gyp@0.6.39"
success Folder in sync.
✨  Done in 3.20s.
bclinkinbeard commented 7 years ago

278 errors here :/

Node 8.5.0, Yarn 1.3.2

jpickwell commented 7 years ago
[10:37 jpickwell@sacred-realm yarn-testing] > rm -fr node_modules/ yarn.lock
[10:37 jpickwell@sacred-realm yarn-testing] > direnv allow
direnv: loading .envrc
direnv: using node 8
direnv: Successfully loaded NodeJS v8.5.0, from prefix (/Users/jpickwell/.local/share/node/versions/node-v8.5.0)
direnv: export +LIBRARY_PATH ~CPATH ~LD_LIBRARY_PATH ~MANPATH ~PATH ~PKG_CONFIG_PATH
[10:37 jpickwell@sacred-realm yarn-testing] > yarn install && yarn check
yarn install v1.3.2
info No lockfile found.
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
[3/4] 🔗  Linking dependencies...
warning " > babel-jest@21.2.0" has unmet peer dependency "babel-core@^6.0.0 || ^7.0.0-alpha || ^7.0.0-beta || ^7.0.0".
[4/4] 📃  Building fresh packages...
success Saved lockfile.
✨  Done in 16.40s.
yarn check v1.3.2
warning "chokidar#fsevents#node-pre-gyp@^0.6.36" could be deduped from "0.6.39" to "node-pre-gyp@0.6.39"
success Folder in sync.
✨  Done in 2.97s.
jpickwell commented 7 years ago

Ok, just tried with a clone of your repo. Fresh clone on master branch and testing in the components package, I see some warnings and 278 errors.

Deleting the yarn.lock files from all packages and root, I get one error when inside the components package Lockfile does not contain pattern: "lerna@^2.0.0".

With no lock files to start with, and running yarn install && yarn check in the root of the repo, I get the following for the check command:

yarn check v1.3.2
error "idyll-components#react-inlinesvg#react@^0.14 || ^15.0" doesn't satisfy found match of "react@16.0.0"
error "idyll-components#react-latex#react@^15.3.0" doesn't satisfy found match of "react@16.0.0"
warning "chokidar#fsevents#node-pre-gyp@^0.6.36" could be deduped from "0.6.39" to "node-pre-gyp@0.6.39"
error Found 2 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

I'm going to go out on a limb and say your issue is related to incompatible dependencies between packages. Of course, I've never used the check command until today, and I've also never worked with multiple packages in a repo.

e-cloud commented 7 years ago

@BYK I've created a demo branch to show how the dedupe functionality not working. see here. I try to upgrade a bunch of deps, but rxjs is not dedulped.

yarn check v1.3.2
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.
warning "@angular/cli#rxjs@^5.4.2" could be deduped from "5.5.2" to "rxjs@5.5.2"
warning "@types/fs-extra#@types/node@*" could be deduped from "8.0.31" to "@types/node@8.0.31"
warning "@angular/cli#@angular-devkit/schematics#rxjs@^5.4.2" could be deduped from "5.5.2" to "rxjs@5.5.2"
info Found 3 warnings.
success Folder in sync.
Done in 2.60s.

see https://github.com/e-cloud/demo-repo-for-various-issues/tree/yarn-dedupe-issue

dominikg commented 6 years ago

also happens with a fresh angular cli project (12 errors)

steps to reproduce

npx -p @angular/cli@1.7.2 ng new my-app --skip-install
cd my-app
yarn install && yarn check

output of yarn check

yarn check v1.5.1
error "ajv" is wrong version: expected "5.5.2", got "6.2.1"
error "@angular/cli#ajv" not installed
warning "chokidar#fsevents#node-pre-gyp@^0.6.39" could be deduped from "0.6.39" to "node-pre-gyp@0.6.39"
warning "@angular/cli#@angular-devkit/schematics#@ngtools/json-schema@^1.1.0" could be deduped from "1.2.0" to "@ngtools/json-schema@1.2.0"
error "webpack#ajv" not installed
error "webpack#ajv-keywords" not installed
error "file-loader#schema-utils#ajv" not installed
error "uglifyjs-webpack-plugin#schema-utils#ajv" not installed
error "postcss-loader#schema-utils#ajv" not installed
error "cache-loader#schema-utils#ajv" not installed
error "postcss-loader#schema-utils#ajv-keywords" not installed
error "file-loader#schema-utils#ajv-keywords" not installed
error "cache-loader#schema-utils#ajv-keywords" not installed
error "uglifyjs-webpack-plugin#schema-utils#ajv-keywords" not installed
info Found 2 warnings.
error An unexpected error occurred: "Found 12 errors.".

versions os: macOS 10.12.6 node: 8.9.4
yarn: 1.5.1