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 check` can error right after having run `yarn install` #6262

Open emilio-martinez opened 6 years ago

emilio-martinez commented 6 years ago

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

What is the current behavior? yarn check can error right after having run yarn install:

➜ rm -rf node_modules && yarn install && yarn check

yarn install v1.9.4
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
info google-closure-compiler-linux@20180716.0.0: The platform "darwin" is incompatible with this module.
info "google-closure-compiler-linux@20180716.0.0" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] 🔗  Linking dependencies...
warning " > tslint-no-redundant-jsdoc-annotations@1.0.1" has unmet peer dependency "tsutils@^2.12.1".
[4/4] 📃  Building fresh packages...
✨  Done in 13.55s.

yarn check v1.9.4
info google-closure-compiler-linux@20180716.0.0: The platform "darwin" is incompatible with this module.
info "google-closure-compiler-linux@20180716.0.0" is an optional dependency and failed compatibility check. Excluding it from installation.
error "nyc#yargs-parser#camelcase" is wrong version: expected "4.1.0", got "1.2.1"
warning "chokidar#fsevents#node-pre-gyp@^0.10.0" could be deduped from "0.10.3" to "node-pre-gyp@0.10.3"
error Found 1 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

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

After having run the above, oddly if I run yarn install --check-files, yarn check won't error; however, if run rm -rf node_modules && yarn install --check-files && yarn check, I'll still get the check error.

I've tried removing the lockfile and rebuilding—same results.

What is the expected behavior?

yarn check should not error right after a clean yarn install.

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

➜ node --version
v8.9.4

➜ yarn --version
1.9.4

➜ sw_vers
ProductName:    Mac OS X
ProductVersion: 10.12.6
BuildVersion:   16G1510
rally25rs commented 6 years ago

Are you able to share your package.json or at least the dependencies used to reproduce this? Thanks!

jmullings commented 6 years ago

+1

{ "name": "commotion", "version": "0.1.0", "private": true, "dependencies": { "@tensorflow/tfjs": "^0.12.4", "ap": "^0.2.0", "async": "^2.6.1", "axios": "^0.18.0", "detect-browser": "^3.0.0", "device": "^0.3.9", "dotenv": "^6.0.0", "flat": "^4.1.0", "got": "^9.0.0", "keccak": "^1.4.0", "meta-scraper": "^2.1.3", "module": "^1.2.5", "node-pre-gyp": "^0.10.0", "object-pair": "^1.0.0", "original-fs": "^1.0.0", "p5": "git@github.com:jmullings/p5.js.git", "path": "^0.12.7", "pixabayjs": "^2.0.5", "react": "^16.4.1", "react-dom": "^16.4.1", "react-qr-scanner": "^0.0.7", "react-scripts": "1.1.4", "rlp": "^2.1.0", "sentiment": "^5.0.1", "twitter": "^1.7.1", "value-pipe": "^1.0.1", "web3": "^1.0.0-beta.35" }, "scripts": { "start": "react-scripts start", "build": "react-scripts build", "test": "react-scripts test --env=jsdom", "eject": "react-scripts eject" } }

emilio-martinez commented 6 years ago

@rally25rs Sorry for the delay—I somehow missed your message but this issue just came back to mind. This is a snapshot of the dependencies (only dev dependencies in this particular project):

"devDependencies": {
    "@ampproject/rollup-plugin-closure-compiler": "0.7.2",
    "@commitlint/cli": "7.1.2",
    "@commitlint/config-angular": "7.1.2",
    "@types/benchmark": "1.0.31",
    "@types/node": "8.10.23",
    "ava": "1.0.0-beta.8",
    "benchmark": "2.1.4",
    "camelcase": "5.0.0",
    "core-js": "2.5.7",
    "coveralls": "3.0.2",
    "es6-symbol": "3.1.1",
    "husky": "0.14.3",
    "kleur": "2.0.2",
    "nodemon": "1.18.4",
    "np": "3.0.4",
    "npm-run-all": "4.1.3",
    "nyc": "13.0.1",
    "prettier": "1.14.3",
    "rimraf": "2.6.2",
    "rollup": "0.66.2",
    "rollup-plugin-filesize": "4.0.1",
    "rollup-plugin-prettier": "0.4.0",
    "rollup-plugin-sourcemaps": "0.4.2",
    "ts-node": "7.0.1",
    "tsconfig-paths": "3.6.0",
    "tslib": "1.9.3",
    "tslint": "5.11.0",
    "tslint-config-standard": "8.0.1",
    "tslint-no-redundant-jsdoc-annotations": "1.0.1",
    "typescript": "2.9.2"
  }

Still get the same warnings, but those specific errors aren't there anymore for Yarn v1.10.1—not sure if there was any change in the version shift.

philihp commented 6 years ago

I'm getting this as well... Here's an example that will replicate it.

https://gist.github.com/philihp/1e0f7b3e6942e097528085dea8cde8cb


❯ node -v
v8.11.4

❯ yarn check
yarn check v1.9.4
error "fsevents#node-pre-gyp" is wrong version: expected "0.10.3", got "0.10.0"
error "fsevents#node-pre-gyp#tar" is wrong version: expected "4.4.6", got "4.4.1"
error Found 2 errors.
info Visit https://yarnpkg.com/en/docs/cli/check for documentation about this command.

In looking inside node_modules/node-pre-gyp, the module that was downloaded was 0.10.3.

yarn.lock
...
node-pre-gyp@^0.10.0:
  version "0.10.3"
  resolved "https://registry.yarnpkg.com/node-pre-gyp/-/node-pre-gyp-0.10.3.tgz#3070040716afdc778747b61b6887bf78880b80fc"
  dependencies:
    detect-libc "^1.0.2"
    mkdirp "^0.5.1"
    needle "^2.2.1"
    nopt "^4.0.1"
    npm-packlist "^1.1.6"
    npmlog "^4.0.2"
    rc "^1.2.7"
    rimraf "^2.6.1"
    semver "^5.3.0"
    tar "^4"
...
package.json
  "dependencies": {
    "@material-ui/core": "^3.0.3",
    "@material-ui/icons": "^3.0.1",
    "@rails/webpacker": "3.5",
    "autobind-decorator": "^2.1.0",
    "autoprefixer": "^7.1.1",
    "axios": "^0.18.0",
    "babel-eslint": "^7.2.3",
    "babel-loader": "^7.1",
    "babel-plugin-syntax-dynamic-import": "^6.18.0",
    "babel-plugin-transform-class-properties": "^6.24.1",
    "babel-plugin-transform-object-rest-spread": "^6.23.0",
    "babel-plugin-transform-runtime": "^6.23.0",
    "babel-polyfill": "^6.23.0",
    "babel-preset-es2015": "^6.24.1",
    "babel-preset-stage-0": "^6.24.1",
    "caniuse-db": "^1.0",
    "caniuse-lite": "^1.0",
    "classnames": "^2.2.5",
    "clipboard-copy": "^2.0.0",
    "compression-webpack-plugin": "^0.4.0",
    "connected-react-router": "^4.4.1",
    "eslint": "^5.7.0",
    "extract-text-webpack-plugin": "^3.0.2",
    "file-loader": "^0.11.2",
    "imagesloaded": "^4.1.1",
    "immutability-helper": "^2.3.1",
    "inputmask": "^3.3.7",
    "jquery": "^3.2.1",
    "jquery-deparam": "^0.5.3",
    "js-cookie": "^2.1.4",
    "js-yaml": "^3.8.4",
    "lodash": "^4.17.4",
    "match-sorter": "^1.8.0",
    "moment": "^2.18.1",
    "namor": "^1.0.1",
    "path-complete-extname": "^0.1.0",
    "postcss-cssnext": "^2.11.0",
    "postcss-smart-import": "^0.7.4",
    "precss": "^1.4.0",
    "prop-types": "^15.5.10",
    "querystring": "^0.2.0",
    "rc-progress": "^2.2.5",
    "react": "^16.0.0",
    "react-actioncable-provider": "^1.0.3",
    "react-addons-shallow-compare": "^15.6.0",
    "react-dom": "^16.0.0",
    "react-dropzone": "^4.2.13",
    "react-fontawesome": "^1.6.1",
    "react-hot-loader": "^4.3.6",
    "react-image-magnify": "^2.0.4",
    "react-image-resizer": "^1.3.0",
    "react-loader": "^2.4",
    "react-redux": "^5.0.7",
    "react-router": "^4.3.1",
    "react-router-dom": "^4.3.1",
    "react-select": "^1.0.0-rc.5",
    "react-table": "^6.5.1",
    "react_ujs": "^2.2.1",
    "redux": "^4.0.0",
    "redux-thunk": "^2.3.0",
    "resolve-url-loader": "^2.0.2",
    "sass-loader": "^6.0",
    "sortablejs": "^1.5.1",
    "sticky-table-headers": "^0.1.19",
    "style-loader": "^0.23.0",
    "uglify-es": "^3.0.25",
    "underscore": "^1.8.3",
    "whatwg-fetch": "^2.0.3"
  },
  "devDependencies": {
    "babel-core": "^6.24.1",
    "babel-jest": "^23.6.0",
    "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
    "babel-preset-env": "^1.5.2",
    "babel-preset-latest": "^6.22.0",
    "babel-preset-react": "^6.24.1",
    "coffee-script": "^1.12.6",
    "enzyme": "^3.7.0",
    "enzyme-adapter-react-16": "^1.6.0",
    "eslint-config-prettier": "^3.0.1",
    "eslint-plugin-jest": "^21.25.0",
    "eslint-plugin-prettier": "^2.6.2",
    "eslint-plugin-react": "^7.11.1",
    "glob": "^7.1.2",
    "husky": "^1.0.0-rc.13",
    "jest": "^23.6.0",
    "jest-junit": "^5.2.0",
    "lint-staged": "^7.2.2",
    "node-sass": "^4.5.3",
    "optimize-js-plugin": "^0.0.4",
    "path": "^0.12.7",
    "path-complete-extname": "^0.1.0",
    "prettier": "^1.14.2",
    "sinon": "^7.0.0",
    "webpack": "^3.12.0",
    "webpack-dev-server": "^2.11.2",
    "webpack-merge": "^4.1.0"
  },
magnosis commented 5 years ago

+1 same issue as @philihp and @emilio-martinez

GO-Shoderu commented 2 years ago

I get this error when I execute yarn install, please help

yarn install v1.22.18 warning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json. [1/4] Resolving packages... warning @ngxs/schematics > @angular-devkit/core > chokidar > fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2. warning Lockfile has incorrect entry for "make-dir@^2.1.0". Ignoring it. warning Lockfile has incorrect entry for "source-map@~0.6.0". Ignoring it. warning Lockfile has incorrect entry for "source-map@~0.6.1". Ignoring it. [2/4] Fetching packages... warning Pattern ["@nrwl/cli@latest"] is trying to unpack in the same destination "C:\Users\shody\AppData\Local\Yarn\Cache\v6\npm-@nrwl-cli-13.8.3-integrity\node_modules\@nrwl\cli" as pattern ["@nrwl/cli@13.8.3","@nrwl/cli@13.8.3","@nrwl/cli@13.8.3","@nrwl/cli@13.8.3"]. This could result in non-deterministic behavior, skipping. warning Pattern ["@nrwl/workspace@latest"] is trying to unpack in the same destination "C:\Users\shody\AppData\Local\Yarn\Cache\v6\npm-@nrwl-workspace-13.8.3-integrity\node_modules\@nrwl\workspace" as pattern ["@nrwl/workspace@13.8.3","@nrwl/workspace@13.8.3","@nrwl/workspace@13.8.3","@nrwl/workspace@13.8.3","@nrwl/workspace@13.8.3"]. This could result in non-deterministic behavior, skipping. warning Pattern ["nx@latest"] is trying to unpack in the same destination "C:\Users\shody\AppData\Local\Yarn\Cache\v6\npm-nx-13.8.3-integrity\node_modules\nx" as pattern ["nx@13.8.3"]. This could result in non-deterministic behavior, skipping. [3/4] Linking dependencies... warning " > apollo-server-express@3.6.5" has unmet peer dependency "express@^4.17.1". warning "@nrwl/angular > jasmine-marbles@0.8.4" has incorrect peer dependency "rxjs@^6.5.3". warning "@nrwl/angular > rxjs-for-await@0.0.2" has incorrect peer dependency "rxjs@^6.0.0". warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.1" has unmet peer dependency "@babel/core@^7.0.1". warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.1" has unmet peer dependency "@babel/preset-env@^7.0.0". warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.1" has unmet peer dependency "babel-loader@^8.0.2". warning "@nrwl/angular > @nrwl/cypress > @cypress/webpack-preprocessor@5.11.1" has unmet peer dependency "webpack@^4 || ^5". error An unexpected error occurred: "EPERM: operation not permitted, unlink 'D:\Documents\projects\graduates\node_modules\@swc\core-win32-x64-msvc\swc.win32-x64-msvc.node'". info If you think this is a bug, please open a bug report with the information provided in "D:\Documents\projects\graduates\yarn-error.log". info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.