What are the Slack Archives?

It’s a history of our time together in the Slack Community! There’s a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.

Because this space is not active, you won’t be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..

Quick question: ```> PhantomInstaller\Installer::installPhantomJS sh: /data/vendor/bin/phantomjs:

Posts: 232 πŸ§‘πŸ»β€πŸš€ - Cadet
edited May 2020 in Help

Quick question:


I keep seeing this happening on different projects while running composer install. Is there any way to fix it?

Welcome!

It looks like you're new here. Sign in or register to get started.

Comments

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    npm install first (or yarn install)

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    this will install phantomjs

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    which will allow composer postscripts to execute successfully

  • SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    edited May 2020

    I would expect that this happens with docker/sdk, right?

  • Posts: 232 πŸ§‘πŸ»β€πŸš€ - Cadet

    Yes

  • Posts: 232 πŸ§‘πŸ»β€πŸš€ - Cadet

    @UK5DS29L2 Thanks for the tip! 'll give it a shot. However, I assumed that this was run through composer and not through npm? the error reporting could be a bit better if it was required to run npm install first.

  • SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    It's about composer, yes.

  • SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Let me bring here some internal discussions regarding the topic in a minute.

  • Posts: 232 πŸ§‘πŸ»β€πŸš€ - Cadet

    I mean it's not keeping me off doing anything, stuff works but I just found it a bit ... weird.

  • SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice
    xxx
    One more annoying thing:
    every time I rundocker/sdk cli composer install -o
    PhantomJS is installed
    sh: /data/vendor/bin/phantomjs: not found
    Caught exception while checking PhantomJS version:
    Undefined offset: 0
      - Installing phantomjs (2.1.1): Downloading (100%)      
    I tried composer install inside cli - sme issue
    
    
    Mike Kalinin
    Does it have any impact?
    
    xxx
    slow comoser install πŸ™‚
    
    Mike Kalinin
    It takes 2 seconds for me to install phantom.js…
    
    But anyway we do not need it in docker at all.
    
    So I would consider removing phantom.js from composer post-install.
    
    xxx
    but you cannot do this globally, many projects are still using vagrant.
    So it should be documented/explained or condiioned
    
    yyy
    @Mike Kalinin Am I right that we don’t use PhantomJS in docker environment and for client’s project I can safely remove it from my composer.json to get rid of installing it for every composer install?
    It causes a delay during gitlab pipeline run.
    
    Mike Kalinin  [15:46 Uhr]
    I am opened for suggestions. How to disable it in some envs?
    
    yyy
    Is it useful for this situation
    "scripts": {
        "post-install-cmd": [
             "[ $COMPOSER_DEV_MODE -eq 0 ] || <your command>"
        ]
    }
    
    
    <https://stackoverflow.com/questions/13087088/composer-run-scripts-only-in-dev-environment>
    
    What environment variable could be used in this situation, like $COMPOSER_DEV_MODE in this example?
    
    
    Mike Kalinin
    Actually we can use
    --no-scripts
    for prod-like mode that is actually used in CI.
    
    Mike Kalinin
    Good finding with COMPOSER_DEV_MODE
    
  • Posts: 232 πŸ§‘πŸ»β€πŸš€ - Cadet

    ok, gist is: I can just run --no-scripts in CI?

  • SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    According to @ULYHPR789, yes.

  • SRE @ Spryker Sprykee Posts: 1,654 ✨ - Novice

    Or maybe it's just an assumption on how to fix the problem in future. I'm not sure. πŸ€”

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    the problem with phantomjs is that it is often built for node, SOMETIMES repo doesnt' allow you to download some file which is not your fault.

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    this could be prevented if the docker had the libvips installed so phantomjs can build itself from source

  • Cloud Platform Architect Sprykee Posts: 781 πŸ§‘πŸ»β€πŸš€ - Cadet

    docker/sdk does not need phantomjs in app container, separate container is used for E2E testing.

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    that's ok, but you could make this not throw errors by modifying the docker image to keep the requirement consistent with docker/non-docker setup

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet
    edited May 2020

    because it doesn't make sense to me to keep separate composer.json files for docker/non-docker

  • Posts: 546 πŸ§‘πŸ»β€πŸš€ - Cadet

    and it doesn't hurt to adjust docker image slightly

Welcome!

It looks like you're new here. Sign in or register to get started.