Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot find module 'portfinder' #841

Closed
kyleoliveiro opened this issue Aug 20, 2018 · 18 comments
Closed

Cannot find module 'portfinder' #841

kyleoliveiro opened this issue Aug 20, 2018 · 18 comments

Comments

@kyleoliveiro
Copy link
Contributor

I'm running Backstop locally via Docker. Everything was fine and dandy, until I ran docker pull backstopjs/backstopjs today. After downloading the latest image, running the same backstop command which was previously working now throws: Error: Cannot find module portfinder.

The Backstop version in the Docker image is apparently v3.5.4, yes, even though the latest on Docker hub right now is v3.5.3.

@ExelleR
Copy link

ExelleR commented Aug 20, 2018

I have the same exact issue.

@zapatoche
Copy link

zapatoche commented Aug 20, 2018

Hi there,
I have the same issue.

It's working again after installing portfinder globally.

@ExelleR
Copy link

ExelleR commented Aug 20, 2018

Installing portfinder did not work for me only rolling back to the v3.2.17 of backstopjs container solved the issue.

@garris
Copy link
Owner

garris commented Aug 20, 2018

That sounds terrible. Sorry everyone. Will look into it.

@garris
Copy link
Owner

garris commented Aug 20, 2018

UPDATE: I could not reproduce the issue. However, there were a few commits not yet published to NPM. These did include some tweaks to the docker implementation for when you are using backstop inside a node script. I don't think this was causing your issue -- but I pushed this to NPM anyway.

So please try pulling down the lastest backstop locally and also from docker and please let me know if the problem is still there. And please provide logs and scenarios if your install is still broken. I really want to make sure the docker version is stable for everyone.

Alright. Thanks.

☮️

image

@zapatoche
Copy link

I have the issue with the local backstop version by the way, not the docker one. I will try again in a when I'm back at work, but my issue was fixed when I installed port finder manually.

@kyleoliveiro
Copy link
Contributor Author

Hi @garris, I've pulled the latest Docker image, but unfortunately still having the same issue. Here's the log:

backstop-log

@ExelleR
Copy link

ExelleR commented Aug 23, 2018

@kyleoliveiro @garris I have the same issue.

@garris
Copy link
Owner

garris commented Aug 23, 2018

Does this happen for puppeteer? Or just Chromy? I suspect this problem can be solved by adding portfinder to package.json as a hard dependency. This dependency was probably included in one of the react packages that was recently moved to dev-dependency.

Here 👉 #813

@thijsvdanker
Copy link

Installing portfinder globally fixed the issue for me.

npm install portfinder -g

(Running locally with chromy).

@kyleoliveiro
Copy link
Contributor Author

I don't think installing portfinder globally would help in cases where Backstop is being run from the Docker container; It would need to be installed inside the container instead of the host machine for it to work.

@garris Puppeteer doesn't work for me, so I'm forced to use Chromy.

For now, I'm getting around this issue by using v3.2.17

@garris garris closed this as completed in a82cff2 Aug 24, 2018
@garris
Copy link
Owner

garris commented Aug 27, 2018

fixed by a82cff2

@seleckis
Copy link

seleckis commented Aug 29, 2018

Hi, I have fresh install of backstopJS 3.5.8. Worked well until I changed engine to "chromy". Now I have the same error.

@garris
Copy link
Owner

garris commented Aug 29, 2018

Ok, apologies. My bad. Please validate using v3.5.9. Thanks!

@cactusa
Copy link
Contributor

cactusa commented Aug 29, 2018

I have just tested this and had no luck. Here is what I get:

BackstopJS v3.5.9
Loading config:  /Users/vladaltanov/Projects/itvplayer-browser/backstopJS.config.js 

COMMAND | Executing core for "test"
createBitmaps | Selected 45 of 45 scenarios.
module.js:491
    throw err;
    ^

Error: Cannot find module 'portfinder'
    at Function.Module._resolveFilename (module.js:489:15)
    at Function.Module._load (module.js:439:25)
    at Module.require (module.js:517:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/Users/vladaltanov/Projects/itvplayer-browser/node_modules/backstopjs/core/util/getFreePorts.js:1:82)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)

This is not even using docker.

@garris
Copy link
Owner

garris commented Aug 29, 2018

Epic fail. 🤦‍♂️

Ok -- just republished. Please try again! v3.5.10

@cactusa
Copy link
Contributor

cactusa commented Aug 29, 2018

Will try that first thing tomorrow when I'm back at the office.

@kyleoliveiro
Copy link
Contributor Author

Just tried v3.5.10. It works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants