yarn install goes to infinite loop

Created on 23 Dec 2016  路  6Comments  路  Source: yarnpkg/yarn

When running yarn install it goes to infinite loop.
Yarn installed globally.
Node v7.1.0

image

Most helpful comment

If anyone still encounters this issue, I was able to fix it with --ignore-scripts:

    "scripts": {
        "postinstall": "yarn install --ignore-scripts"
    },

Yarn version is 1.15.2

All 6 comments

Do you have anything defined in the scripts section of your package.json?

Yes.

"scripts": {
        "install": "yarn install",
        "task": "./node_modules/.bin/gulp --gulpfile ./config/tasks.js --cwd .",
        "clean": "./node_modules/.bin/gulp --gulpfile ./config/tasks.js --cwd . clean",
        "webpack": "webpack"
    }

I call npm run install from other build system (sbt) to install js deps when resolving dependencies for main project.
If I remove "install": "yarn install" -- everything is OK. Hmm, where is the problem here? I can't use install name for npm script?

You can use installas the name for npm scripts, but if you look at the docs you'll see that install is just an alias for post install. What's happening here is yarn installs the packages, then the install script (or postinstall) gets called. Which does the same thing.

You really don't need a script that says yarn install since you could just type that in your terminal with yarn installed globally.

I have a postinstall script that calls yarn install. I am trying to migrate from npm. I had this before:

    "postinstall": "npm install --no-save [email protected] --runtime=electron --target=1.7.9"

which works great: npm install is followed by the install of grpc then everything is done, no infinite loop.

I change it to:

    "postinstall": "yarn install --no-save [email protected] --runtime=electron --target=1.7.9"

and then yarn install goes to an infinite loop, unlike npm.

So, after yarn install is finished, how do I automatically run another install?

@trusktr did you manage to workaround this issue? I am facing the same error.

If anyone still encounters this issue, I was able to fix it with --ignore-scripts:

    "scripts": {
        "postinstall": "yarn install --ignore-scripts"
    },

Yarn version is 1.15.2

Was this page helpful?
0 / 5 - 0 ratings