cypress-io / circleci-orb

Install, cache and run Cypress.io tests on CircleCI with minimal configuration.
https://circleci.com/orbs/registry/orb/cypress-io/cypress
MIT License
159 stars 101 forks source link

npx wait-on failing #119

Closed Sdwz closed 5 years ago

Sdwz commented 5 years ago

Greetings,

Since this morning, we have failure on Circle CI due to npx wait-on.

Here is the error message :

internal/modules/cjs/loader.js:582
    throw err;
    ^

Error: Cannot find module '/root/.npm/_npx/1011/lib/node_modules/wait-on/node_modules/core-js/scripts/postinstall'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! core-js@2.6.6 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the core-js@2.6.6 postinstall script. 

Thanks for your input.

Cheers

bahmutov commented 5 years ago

can you try it again - seems it is just a temp network hiccup, the wait-on has passed several times in this project https://circleci.com/gh/bahmutov/demo-battery-api/50

Sdwz commented 5 years ago

This is still happening right now.

#!/bin/bash -eo pipefail
npx wait-on http://localhost:3000
internal/modules/cjs/loader.js:582
    throw err;
    ^

Error: Cannot find module '/root/.npm/_npx/917/lib/node_modules/wait-on/node_modules/core-js/scripts/postinstall'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! core-js@2.6.7 postinstall: `node scripts/postinstall`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the core-js@2.6.7 postinstall script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2019-05-20T23_38_40_569Z-debug.log
Install for wait-on@latest failed with code 1
Exited with code 1
Sdwz commented 5 years ago

Also your project doesn't use the wait-on config, so npx wait-on isn't triggered.

You'll have to have something similar to reproduce the issue :

 cypress/run:
          build: 'yarn build'
          start: 'yarn start'
          **wait-on: 'http://localhost:3000'**
          yarn: true
          store_artifacts: true
bahmutov commented 5 years ago

Hmm you are right, I need to check it more carefully

Sent from my iPhone

On May 20, 2019, at 19:42, Sdwz notifications@github.com wrote:

Also your project doesn't use the wait-on config, so npx wait-on isn't triggered.

You'll have to have something similar to reproduce the issue :

cypress/run: build: 'yarn build' start: 'yarn start' wait-on: 'http://localhost:3000' yarn: true store_artifacts: true — You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub, or mute the thread.

Sdwz commented 5 years ago

Thanks !

bahmutov commented 5 years ago

@Sdwz how about this project that uses wait-on https://circleci.com/gh/bahmutov/react-server-example/1 ?

Sdwz commented 5 years ago

Well mine still breaks with the above configuration. I have 0 idea what I do wrong, even connected to the container on circle the command breaks on its own.

Sdwz commented 5 years ago

Wanna add I had no issue Friday.

JouiiinO commented 5 years ago

Same thing here, got exactly the same error right now. It was fine yesterday.

bahmutov commented 5 years ago

yeah, hard to say why this would fail - maybe because this Orb just uses the latest version of wait-on - can I suggest installing wait-on as NPM dependency in your project? I will reopen this issue, even if I don't know the answer to this problem.

JouiiinO commented 5 years ago

Weird thing is wait-on hasn't been updated since November last year: https://github.com/jeffbski/wait-on/releases

Sdwz commented 5 years ago

Somehow it's working fine this morning.

Maybe one of the deps got fucked up

JouiiinO commented 5 years ago

I can confirm that it's fine now, without any update on my side.

SUSANO-O commented 5 years ago

hello, how can I configure wait-on to work in cypress. thanks for your help

bahmutov commented 5 years ago

@SUSANO-O https://github.com/cypress-io/circleci-orb/blob/master/docs/examples.md#wait-for-server-to-respond

seenickcode commented 4 years ago

Hi guys, I'm getting this myself. Maybe I need to clear some kind of cache? Here's my config:

version: 2.1
orbs:
  cypress: cypress-io/cypress@1
workflows:
  build:
    jobs:
      - cypress/run:
          start: FSF_ENV_NAME=stg npm start
          command: npx cypress run --config baseUrl=http://localhost:3000
          wait-on: 'http://localhost:3000'

CircleCI stuck on this step with the same error:

#!/bin/bash -eo pipefail
npx wait-on http://localhost:3000
internal/modules/cjs/loader.js:582
    throw err;
    ^

Error: Cannot find module '/root/.npm/_npx/765/lib/node_modules/wait-on/node_modules/core-js/scripts/postinstall'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Function.Module.runMain (internal/modules/cjs/loader.js:741:12)
    at startup (internal/bootstrap/node.js:285:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:739:3)
maxstralka commented 4 years ago

It's also failing for me out of the blue. Here's the CircleCI output:

#!/bin/bash -eo pipefail
npx wait-on http://localhost:3000
npx: installed 15 in 6.267s
Cannot find module 'lodash/fp'

Exited with code exit status 1
maxstralka commented 4 years ago

Nevermind. Seem to have been a network issue. The circle CI job runs without a problem a few hours later...