thinktandem / drupal-contributions

Lando tooling, events, and scripts to facilitate Drupal contributions.
81 stars 36 forks source link

cross-env: not found #47

Closed smustgrave closed 2 years ago

smustgrave commented 3 years ago

First off thank you for such a tool! It really has helped me as a developer

I'm currently trying to run some drupal core tests using the nightwatch tool but keep getting

$ cross-env BABEL_ENV=development node -r dotenv-safe/config -r @babel/register ./node_modules/.bin/nightwatch --config ./tests/Drupal/Nightwatch/nightwatch.conf.js --tag core /bin/sh: 1: cross-env: not found error Command failed with exit code 127. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

Here is my lando file. I have had to make some tweaks to it but I left the nightwatch stuff alone

`name: drupal-contributions-drupal9.2 recipe: drupal9 config: webroot: web xdebug: "debug,develop" config: php: ./lando-src/php.ini

services: appserver: build_as_root:

Note that you will want to use the script for the major version of node you want to install

  # See: https://github.com/nodesource/distributions/blob/master/README.md#installation-instructions
  - curl -sL https://deb.nodesource.com/setup_12.x | bash -
  - apt-get install -y nodejs
  - npm install --global yarn

run:

@todo remove invocation of drupal-phpunit-upgrade again once https://www.drupal.org/project/drupal/issues/3099061 is resolved.

- cd /app && composer require drush/drush && composer install && composer run-script drupal-phpunit-upgrade

overrides:
  environment:
    SIMPLETEST_BASE_URL: "https://drupal-contributions-drupal9.2.lndo.site/"
    SIMPLETEST_DB: "sqlite://localhost/tmp/db.sqlite"
    MINK_DRIVER_ARGS_WEBDRIVER: '["chrome", {"browserName":"chrome","chromeOptions":{"args":["--disable-gpu","--headless", "--no-sandbox"]}}, "http://chrome:9515"]'
    LANDO_HOST_IP: "host.docker.internal"
    XDEBUG_CONFIG: "remote_enable=1 remote_host=host.docker.internal"
    # Nightwatch
    DRUPAL_TEST_BASE_URL: 'http://appserver'
    DRUPAL_TEST_DB_URL: 'mysql://drupal9:drupal9@database:3306/drupal9'
    DRUPAL_TEST_WEBDRIVER_HOSTNAME: chrome
    DRUPAL_TEST_WEBDRIVER_PORT: 9515
    DRUPAL_TEST_CHROMEDRIVER_AUTOSTART: 'false'
    DRUPAL_TEST_WEBDRIVER_CHROME_ARGS: "--disable-gpu --headless --no-sandbox"
    DRUPAL_NIGHTWATCH_OUTPUT: reports/nightwatch
    DRUPAL_NIGHTWATCH_IGNORE_DIRECTORIES: node_modules,vendor,.*,sites/*/files,sites/*/private,sites/simpletest

build:
  - /usr/local/bin/composer global require --dev drupal/coder
  - /usr/local/bin/composer global require dealerdirect/phpcodesniffer-composer-installer
  - /app/vendor/bin/phpcs --config-set installed_paths /app/vendor/drupal/coder/coder_sniffer

chrome: type: compose app_mount: false services: image: drupalci/webdriver-chromedriver:production command: chromedriver --log-path=/tmp/chromedriver.log --verbose --whitelisted-ips=

tooling: drush: service: appserver cmd: /app/vendor/bin/drush

si: service: appserver description: Install Drupal cmd:

`

smustgrave commented 3 years ago

Sorry for the bad formatting. Any help would be appreciated.

smustgrave commented 3 years ago

Adding - cd /app/web/core && yarn install to the build as root section resolved this

cabagach commented 2 years ago

Thanks for sharing how you got it working, perhaps this issue can be closed?

smustgrave commented 2 years ago

Sure

cabagach commented 2 years ago

Thanks. And how about #48, did you get it working?