This is a repository which contains the following:
- A script that calls
nuxi
programmatically withrunCommand
- A nuxt application (
my-nuxt-app
). - The
nuxt
app contains just a page that says "Hello from Katerina", here is the code: my-nuxt-app/app.vue
pnpm i
and in the nuxt app:
cd my-nuxt-app && pnpm i
Using "nuxi": "^3.9.1"
and runCommand("dev", ["my-nuxt-app"])
, runCommand
ignores the name of the project (the directory), and runs the command in the root directory.
I would expect this to work exactly like running:
npx nuxi dev my-nuxt-app
If you run the above command, you will see that it works as expected.
If you run
npx tsx run-nuxt.ts
you will see that it does not pick up the directory, and runs the command in the root directory, it shows the default Nuxt template, instead of "Hello from Katerina".