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.37k stars 2.72k forks source link

Never-ending build of packages #7779

Closed allaniftrue closed 4 years ago

allaniftrue commented 4 years ago

image

The never-ending build of packages. Using yarn version v1.21.1 && node v8.12.0 (npm v6.4.1).

I have tried

  1. removing node modules and re-install again.
  2. clearing cache and back to step 1

packages inherited from other devs

"dependencies": {
    "@babel/polyfill": "^7.0.0",
    "@fortawesome/fontawesome": "^1.1.7",
    "@fortawesome/fontawesome-free-brands": "^5.0.12",
    "@fortawesome/fontawesome-free-regular": "^5.0.12",
    "@fortawesome/fontawesome-free-solid": "^5.0.12",
    "@fortawesome/vue-fontawesome": "^0.0.22",
    "@johmun/vue-tags-input": "^2.0.0",
    "@lessworkjs/optional": "^1.0.1",
    "algoliasearch": "^3.32.0",
    "animate.css": "^3.7.2",
    "animated-number-vue": "^1.0.0",
    "axios": "^0.18.0",
    "babel-preset-stage-2": "^6.24.1",
    "bootstrap": "^4.1.1",
    "chart.js": "^2.8.0",
    "coinify": "^2.0.2",
    "cropperjs": "^1.4.3",
    "deep-object-diff": "^1.1.0",
    "fabric": "^3.0.0",
    "filepond": "^3.3.0",
    "filepond-plugin-file-validate-size": "^2.2.0",
    "filepond-plugin-file-validate-type": "^1.2.0",
    "filepond-plugin-image-preview": "^3.1.3",
    "flatted": "^2.0.1",
    "hls.js": "^0.12.2",
    "jquery": "^3.3.1",
    "js-cookie": "^2.2.0",
    "kalendar-vue": "^0.2.8",
    "laravel-echo": "^1.6.1",
    "laravel-mix-tailwind": "^0.1.0",
    "laravel-vue-pagination": "^2.2.0",
    "lodash": "^4.17.11",
    "loglevel": "^1.6.6",
    "moment": "^2.24.0",
    "moment-range": "^4.0.2",
    "node-gyp": "^6.0.0",
    "normalize.css": "^8.0.1",
    "object-to-formdata": "^1.6.4",
    "popper.js": "^1.14.3",
    "pretty-checkbox-vue": "^1.1.9",
    "pusher-js": "^5.0.3",
    "sweetalert2": "^7.28.4",
    "tui-image-editor": "^3.5.1",
    "tz-lookup": "^6.1.20",
    "v-mask": "^1.3.3",
    "v-tooltip": "^2.0.0-rc.33",
    "vform": "^1.0.0",
    "vue": "^2.5.16",
    "vue-aplayer": "^1.6.1",
    "vue-bulma-accordion": "^0.4.7",
    "vue-captcha": "^1.0.2",
    "vue-carousel": "^0.16.2",
    "vue-chartjs": "^3.4.2",
    "vue-click-outside": "^1.0.7",
    "vue-cropperjs": "^2.2.2",
    "vue-custom-scrollbar": "^1.1.0",
    "vue-datetime-picker": "^0.2.1",
    "vue-filepond": "^4.0.1",
    "vue-full-calendar": "^2.7.0",
    "vue-fullscreen": "^2.1.4",
    "vue-goodshare": "^1.1.0",
    "vue-google-autocomplete": "^1.1.0",
    "vue-i18n": "^7.6.0",
    "vue-images": "^1.1.0",
    "vue-instant-pdf-viewer": "^1.0.2",
    "vue-instantsearch": "^2.0.0",
    "vue-js-popover": "^1.1.7",
    "vue-js-toggle-button": "^1.3.0",
    "vue-masonry": "^0.11.7",
    "vue-meta": "^1.5.0",
    "vue-multiselect": "^2.1.3",
    "vue-nav-tabs": "^0.5.7",
    "vue-pdfviewer": "^1.0.2",
    "vue-perfect-scrollbar": "^0.1.0",
    "vue-plyr": "^5.1.3",
    "vue-router": "^3.0.1",
    "vue-select": "^2.5.1",
    "vue-slider-component": "^3.0.16",
    "vue-spinner": "^1.0.3",
    "vue-star-rating": "^1.6.0",
    "vue-youtube-embed": "^2.2.1",
    "vue2-datatable-component": "^2.3.0",
    "vue2-datepicker": "^2.6.1",
    "vue2-filters": "^0.6.0",
    "vuex": "^3.0.1",
    "vuex-persistedstate": "^2.5.4",
    "vuex-router-sync": "^5.0.0"
  },
  "devDependencies": {
    "@babel/plugin-proposal-export-default-from": "^7.2.0",
    "@vue/cli-plugin-eslint": "^3.0.0-beta.9",
    "@vue/cli-service": "^3.0.0-beta.9",
    "@vue/eslint-config-standard": "^3.0.0-beta.9",
    "babel-helper-vue-jsx-merge-props": "^2.0.3",
    "babel-plugin-syntax-dynamic-import": "^6.18.0",
    "browser-sync": "^2.24.7",
    "browser-sync-webpack-plugin": "2.0.1",
    "cross-env": "^5.1.5",
    "eslint-config-airbnb-base": "^14.0.0",
    "eslint-plugin-import": "^2.18.2",
    "laravel-mix": "^2.1.11",
    "tailwindcss": "^0.6.5",
    "vue-template-compiler": "^2.5.16",
    "webpack-bundle-analyzer": "^2.11.2"
  }
allaniftrue commented 4 years ago

After a 4 hours

image

rally25rs commented 4 years ago

It might also be worth reporting this as an issue with canvas. https://github.com/Automattic/node-canvas/issues Yarn is just waiting for the install scripts supplied by canvas to finish running.

lehisanchez commented 4 years ago

I, too, am experiencing this issue. It happens when deploying my Rails 6 app to an Ubuntu 18.04 server using Capistrano. The issue is experienced both when Capistrano runs 'yarn install' and when I manually run 'yarn install' on the remote server (Ubuntu).

Ubuntu 18.04 on VMWARE | 8 CPU | 16GB RAM | 20GB HD

Running Yarn v1.21.1

{ "name": "MyApp", "private": true, "dependencies": { "@rails/actioncable": "^6.0.0", "@rails/activestorage": "^6.0.0", "@rails/ujs": "^6.0.0", "@rails/webpacker": "4.2.2", "bootstrap": "^4.4.1", "jquery": "^3.4.1", "popper.js": "^1.16.0", "stimulus": "^1.1.1", "turbolinks": "^5.2.0", "node-sass": "^4.13.0" }, "version": "0.1.0", "devDependencies": { "@fortawesome/fontawesome-free": "^5.12.0", "webpack": "4.41.5", "webpack-dev-server": "^3.9.0" } }

The Capistrano deploy process hangs at 'yarn install'

03:45 deploy:assets:precompile 01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile 01 yarn install v1.21.1 01 [1/4] Resolving packages... 01 [2/4] Fetching packages... 01 warning sha.js@2.4.11: Invalid bin entry for "sha.js" (in "sha.js"). 01 info fsevents@1.2.11: The platform "linux" is incompatible with this module. 01 info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation. 01 [3/4] Linking dependencies... 01 [4/4] Building fresh packages...

allaniftrue commented 4 years ago

Not sure what the issue was. I tried to build using a different machine, everything works again. :(

bytemofan commented 4 years ago

So do I. Never end......

node: v10.18.1 npm: 6.13.4 yarn: 1.22.0

package.json:

{
    "name": "@xure/bricks",
    "version": "1.1.16",
    "main": "./dist/bricks-plugin.umd.min.js",
    "types": "./dist/types/index.d.ts",
    "scripts": {
        "serve": "vue-cli-service serve",
        "lint": "vue-cli-service lint",
        "dev": "vue-cli-service build --target lib --name bricks-plugin src/index.ts --watch --mode=production",
        "build": "vue-cli-service build --target lib --name bricks-plugin src/index.ts"
    },
    "peerDependencies": {
        "vue": "^2.6.10"
    },
    "dependencies": {
        "vue-class-component": "^7.1.0",
        "vue-property-decorator": "^8.2.1"
    },
    "devDependencies": {
        "@byted/tslint-rules": "^1.0.4",
        "@types/swiper": "^4.4.3",
        "@types/zepto": "^1.0.30",
        "@vue/cli-plugin-babel": "^3.8.0",
        "@vue/cli-plugin-typescript": "^3.8.1",
        "@vue/cli-service": "^3.8.4",
        "babel-core": "7.0.0-bridge.0",
        "less": "^3.0.4",
        "less-loader": "^5.0.0",
        "swiper": "^4.5.0",
        "typescript": "^3.5.2",
        "vue-template-compiler": "^2.6.10"
    },
    "license": "MIT",
    "browserslist": [
        "> 1%",
        "last 2 versions",
        "not ie <= 8"
    ],
    "readme": "ERROR: No README data found!"
}

I just want to install md5,run:

yarn add md5 --save-dev

I got this.......

image

image

Babeetlebum commented 4 years ago

I reproduced the bug with the following Dockerfile :

FROM node:10.20.1
RUN yarn init --yes
RUN yarn add canvas

docker build --no-cache . Done in 1140.50s. (~20min)

The versions in the docker :

I tried with npm and as far as I can tell the build didn't finish at all

rally25rs commented 4 years ago

I'd like to reiterate that I don't think this is a yarn issue. Yarn is just going to call canvas's install script and wait for it to exit.

I can't repro it myself, even with the Dockerfile provided by @Babeetlebum it only takes 12s

$ docker build .
Sending build context to Docker daemon  24.37MB
Step 1/3 : FROM node:10.20.1
10.20.1: Pulling from library/node
1c6172af85ee: Pull complete
b194b0e3c928: Pull complete
1f5ec00f35d5: Pull complete
93b1353672b6: Pull complete
3d7f38db3cca: Pull complete
21e102f9fe89: Pull complete
1f9c0020f4f4: Pull complete
5ab83c758454: Pull complete
654868f0dc71: Pull complete
Digest: sha256:0e2671bc0702132989b2b5142617d47c421bd304acd924fbff812370f6107db2
Status: Downloaded newer image for node:10.20.1
 ---> c5f1efe092a0
Step 2/3 : RUN yarn init --yes
 ---> Running in 38bb5ac97aab
yarn init v1.22.4
warning The yes flag has been set. This will automatically answer yes to all questions, which may have security implications.
success Saved package.json
Done in 0.07s.
Removing intermediate container 38bb5ac97aab
 ---> 417cb343e9f9
Step 3/3 : RUN yarn add canvas
 ---> Running in 1b04748b6d58
yarn add v1.22.4
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 68 new dependencies.
info Direct dependencies
└─ canvas@2.6.1
info All dependencies
├─ abbrev@1.1.1
...etc...
└─ yallist@3.1.1
Done in 12.36s.
Removing intermediate container 1b04748b6d58
 ---> 42420ca4ea8e
Successfully built 42420ca4ea8e

For those than can repro the slowness, my recommendation for trying to find what is causing it would be to run the yarn install and skipping install scripts with the --ignore-scripts parameter, then manually run the canvas install script

yarn install --ignore-scripts
cd node_modules/canvas/
yarn run node-pre-gyp install --fallback-to-build

This should let you see the console output for the node-pre-gyp command and give you a better sense of what it is doing.


I'm going to close this issue for now because there is nothing yarn can do to make canvas' install and compilation of C code faster, but if anyone finds that it is a direct yarn problem then we can certainly reopen this.

rjwaltz commented 1 year ago

image the same issue here, timestamp Mar 09 2023.

rjwaltz commented 1 year ago

image the same issue here, timestamp Mar 09 2023.

yarn version 1.22.19

Sunny-Sam commented 1 year ago

Still waiting 🥲 image