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

Error: Cannot find module '../build/safe-execute' #570

Open
wKich opened this issue Dec 6, 2018 · 11 comments
Open

Error: Cannot find module '../build/safe-execute' #570

wKich opened this issue Dec 6, 2018 · 11 comments

Comments

@wKich
Copy link

wKich commented Dec 6, 2018

I get this error when I try to run screenshot tests in my project. I think error is appears after switching between branches. Here closed issue #466, but I don't understand why it closed. It's really frustrating

Error: Cannot find module '../build/safe-execute'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:580:15)
    at Function.Module._load (internal/modules/cjs/loader.js:506:25)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/kich/Work/skbkontur/retail-ui/node_modules/wd/lib/commands.js:22:27)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:537:12)
    at Function.Module._load (internal/modules/cjs/loader.js:529:3)
    at Module.require (internal/modules/cjs/loader.js:636:17)
    at require (internal/modules/cjs/helpers.js:20:18)
    at Object.<anonymous> (/Users/kich/Work/skbkontur/retail-ui/node_modules/wd/lib/element-commands.js:10:16)
    at Module._compile (internal/modules/cjs/loader.js:688:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:699:10)
    at Module.load (internal/modules/cjs/loader.js:598:32)
@justinfagnani
Copy link

I somehow got this error in a project and I can't find a way to solve it yet. A fresh checkout and npm install still produces the error, and if I inspect the wd package, I can see the require for ../build/safe-execute and that the entire build/ directory just doesn't exist. This seems like some sort of clear packaging error, or a skipped postInstall build step. Anyone have ideas?

@usergenic
Copy link

@admc it appears that npm no longer builds the necessary scripts on post-install, can these just be built as part of the publishing process? I can't get any of the tools built with wd to function without hacks/workarounds.

@admc
Copy link
Owner

admc commented Apr 28, 2021

Hey folks, sorry this is breaking for you. I honestly haven't worked on this in such a long time that I'm not sure how to fix it. If someone comes up with a fix, id be happy to merge and publish. Maybe @jlipps or @imurchie might have an idea of what to do here?

@jepstein-eagle
Copy link

This issue has been a problem for our teams as well. As a temporary workaround, we added node node_modules/wd/scripts/build-browser-scripts.js to postinstall in our package.json. If someone has an idea how to fix this in this repo as per @admc that would be greatly appreciated.

@joshuapinter
Copy link

@jepstein-eagle Great work, thanks for sharing!

@admc I feel that pain. Would you recommend those of us still using wd to migrate to wdio sooner rather than later? Thanks for all your efforts on this btw.

@jlipps
Copy link
Collaborator

jlipps commented Jun 2, 2021

Hi everyone, I used to help maintain this project, but unfortunately haven't had time to keep it up to date on top of regular Appium maintenance. I definitely recommend wdio as a substitute. It's very well maintained and full featured. I've been using it for all my new projects for quite some time.

@joshuapinter
Copy link

@jlipps Thanks for the honesty and recommendation. Do you know of or have any recommendations on a guide/steps to migrate from wd to wdio? Thanks!

@jlipps
Copy link
Collaborator

jlipps commented Jun 2, 2021

@christian-bromann do you know of any guide like this?

@christian-bromann
Copy link

mhm 🤔 not really. We have written codemods to help Protractor users to migrate to WebdriverIO. Given that wd can be written in many flavors, e.g. using async/await, via chaining or callbacks it would be hard to do that for this tool.

@joshuapinter unfortunately I can't give you an easy solution here other than rewriting. I am happy to help in the process. Join our community channel if you have questions or come across any issues.

@joshuapinter
Copy link

@christian-bromann @jlipps Thanks for the tips, gents. We'll make the move at some point and ask any questions in the community channel. Cheers! 🍻

@Gurjap
Copy link

Gurjap commented Jul 30, 2022

Yarn install --force worked for me

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

9 participants