Is it possible to create the project from the Node docker image?
Hey all!
I am trying to start up a project without installing node & npm on my machine, so I'm using docker, but I get an error when running the
npm create
command.
2 Replies
Hi @Romain 'Maz' B.. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:
----------------------
Short answer: yes, but you should run the init command inside a container with a proper working directory and mounted volume, not directly as the default root of the image.
Try this:
- Create a project in the current host directory:
- Or choose a package manager explicitly:
Why your command failed: you ran npm in the container root (/) without a writable/project context; nuxi tries to scaffold into frontend but the environment isn’t set up. After creation, you can follow the regular Nuxt install/dev steps as documented (Node 20+ recommended) (Installation).
For future Docker usage with Nuxt apps, see the official multi-stage Docker examples using pnpm or Bun (copy project, install, build, then run .output/server/index.mjs) (Deploy with Docker).
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
<@601146927005827074> Kapa.ai is still learning and improving, please let me know how I did by reacting below.