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.
maz@maz:/media/maz/SSD/websites$ docker run node:alpine npm create nuxt@latest frontend
npm warn exec The following package was not found and will be installed: create-nuxt@3.28.0

> npx
> "create-nuxt" frontend

[nuxi] ℹ Welcome to Nuxt!
[nuxi] ℹ Creating a new project in frontend.
npm error code 1
npm error path /
npm error command failed
npm error command sh -c "create-nuxt" frontend
npm notice
npm notice New patch version of npm available! 11.5.1 -> 11.5.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.5.2
npm notice To update run: npm install -g npm@11.5.2
npm notice
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-08-27T07_19_21_557Z-debug-0.log
maz@maz:/media/maz/SSD/websites$ docker run node:alpine npm create nuxt@latest frontend
npm warn exec The following package was not found and will be installed: create-nuxt@3.28.0

> npx
> "create-nuxt" frontend

[nuxi] ℹ Welcome to Nuxt!
[nuxi] ℹ Creating a new project in frontend.
npm error code 1
npm error path /
npm error command failed
npm error command sh -c "create-nuxt" frontend
npm notice
npm notice New patch version of npm available! 11.5.1 -> 11.5.2
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.5.2
npm notice To update run: npm install -g npm@11.5.2
npm notice
npm error A complete log of this run can be found in: /root/.npm/_logs/2025-08-27T07_19_21_557Z-debug-0.log
2 Replies
kapa.ai
kapa.ai4d ago
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:
docker run --rm -it -v "$PWD":/app -w /app node:22-alpine \
sh -c 'corepack enable && npm create nuxt@latest frontend'
docker run --rm -it -v "$PWD":/app -w /app node:22-alpine \
sh -c 'corepack enable && npm create nuxt@latest frontend'
- Or choose a package manager explicitly:
docker run --rm -it -v "$PWD":/app -w /app node:22-alpine \
sh -c 'corepack enable && npm create nuxt@latest frontend -- --packageManager=pnpm'
docker run --rm -it -v "$PWD":/app -w /app node:22-alpine \
sh -c 'corepack enable && npm create nuxt@latest frontend -- --packageManager=pnpm'
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: ----------------------
kapa.ai
kapa.ai4d ago
<@601146927005827074> Kapa.ai is still learning and improving, please let me know how I did by reacting below.

Did you find this page helpful?