Custom integration - turbo cannot find binary path
Hello,
I ran into a bit of an issue with both just running "npx @vue-storefront/cli create integration" (found here: https://docs.alokai.com/integrations/custom/quick-start), as well as using the boilerplate from "https://github.com/vuestorefront/integration-boilerplate" directly (cloning it and trying to run it)
Using the npx command prompts me to choose a name, the framework and the package manager.
It just continous on with its tasks until building the boilerplate where it runs into the following error:
Error: Command failed with exit code 1: npm run build
> build
> turbo run build
x could not resolve workspaces: We detected multiple package managers in
| your repository: npm, yarn. Please remove one of them.
-> We detected multiple package managers in your repository: npm, yarn.
Please remove one of them.
I would just like to use the npx command because to be honest, I am lazy and just try to look into moving a project we have at the company from an old vue-storefront version to this one.
But I can just not figure out why even when I select NPM during the prompts it keeps on bringing this up.
Anyway, if I afterwards cd into the folder it created for me, make sure to remove yarn, change all the still to yarn referencing scripts to npm, and run "npm run build", it presents me with the next error:
build turbo run buildx could not resolve workspaces: cannot find binary path
-> cannot find binary path
Beeing stuborn and deciding to ignore all that and still running "npm run dev", it spins up a server on my machine.
BUT it appears to not be working, because the example method on that page it gives me under a localhost address just does not what you would expect to happen.
Also I am presented with some errors in my powershell window as you can see in the attachement, since Discord did not allow me to post that inside code fences.10 Replies
TBH I am stuck here.....
Am I missing something from the docs?
But they are quite sparse for the custom integration part.
Sorry for the long post...I was just at my wits end.
Can you show how you register your custom integration in the middleware?
I also see that you run the ApiClient along the middleware+storefront. That might explain your issues with running it. The integration boilerplate is designed to be a separate repository from which you build a package that later you register in the middleware. Sometimes this might be too much of an overhead so you can include the integration in your monorepo but you shouldn't run the integration itself along the middleware and the storefront.
"Can you show how you register your custom integration in the middleware? "
I guess I can do that, but I did not change anything in there.
From what I gathered I should be able to just run the clean boilerplate, before I change anything?
there's no such package as
@vue-storefront/integration-boilerplate-api/server
instead youy should provide path to the integration that you have createdShould it not resolve to the index.server.ts?
My mistake, it should not.
There is none as you stated.
I was missing out on running the build command with the api-client package it seems.
Doing that gave me the proper dir it was looking for.
Maybe that was in fact all I was missing.
It seems like it really was.
The example is working properly and I should be able to start experimenting with it now.
Thanks for your time and patience
no problem, good luck 😉