sitecrafting / lando-node-cypress

Run Cypress inside a Lando-compatible Node container
https://hub.docker.com/r/sitecrafting/lando-node-cypress/
0 stars 1 forks source link

Error attempting ot stand up an Acquia Lando recipe with Cypress #3

Open brooke-heaton opened 1 year ago

brooke-heaton commented 1 year ago

I am attempting to add Cypress to an Acquia Lando recipe but continually see this error when running lando rebuild -y

My .lando.yml includes this:

services:
  cypress:
    type: node:14
    run:
      - npm install cypress
    overrides:
      image: 'sitecrafting/lando-node-cypress:8.11'
Scanning to determine which services are ready... Please stand by...

> cypress@12.6.0 postinstall /app/node_modules/cypress
> node index.js --exec install

/app/node_modules/is-installed-globally/index.js:12
        } catch {
                ^

SyntaxError: Unexpected token {
    at createScript (vm.js:80:10)
    at Object.runInThisContext (vm.js:139:10)
    at Module._compile (module.js:616:28)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/app/node_modules/cypress/lib/util.js:24:29)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)

    at Module.require (module.js:596:17)
brooke-heaton commented 1 year ago

FWIW, my index.js inside of is-installed-globally is:

'use strict';
const fs = require('fs');
const globalDirs = require('global-dirs');
const isPathInside = require('is-path-inside');

module.exports = (() => {
        try {
                return (
                        isPathInside(__dirname, globalDirs.yarn.packages) ||
                        isPathInside(__dirname, fs.realpathSync(globalDirs.npm.packages))
                );
        } catch {
                return false;
        }
})();